Commits

Yuya Nishihara committed 3b93729

reporegistory: restore original behavior of setActiveTabRepo('') (fixes #2279)

Backed out changeset f06d377cc564.

setActiveTabRepo(''), which is called when all repos are closed, should switch
off the current active flag.

Comments (0)

Files changed (1)

tortoisehg/hgqt/reporegistry.py

                 self.showShortPaths))
         oldmodel.deleteLater()
         self.expand()
-        self.setActiveTabRepo()
         self._pendingReloadModel = False
 
     def _getItemAndAncestors(self, it):
             m.addRepo(group, root, -1)
             self.updateSettingsFile()
 
-    def setActiveTabRepo(self, root=None):
+    def setActiveTabRepo(self, root):
         """"
         The selected tab has changed on the workbench
         Unmark the previously selected tab and mark the new one as selected on
         the Repo Registry as well
         """
-        it = None
-        if root:
-            root = hglib.fromunicode(root)
-            if self._activeTabRepo:
-                self._activeTabRepo.setActive(False)
-            m = self.tview.model()
-            it = m.getRepoItem(root, lookForSubrepos=True)
-        elif self._activeTabRepo:
-            it = self._activeTabRepo
+        root = hglib.fromunicode(root)
+        if self._activeTabRepo:
+            self._activeTabRepo.setActive(False)
+        m = self.tview.model()
+        it = m.getRepoItem(root, lookForSubrepos=True)
         if it:
             self._activeTabRepo = it
             it.setActive(True)