Commits

Angel Ezquerra  committed f06d377

reporegistry: activate the current repository entry after a model reload

Without this change the repository registry entry corresponding to the active
tab was deactivated after a repository registry reload. This would happen when
changing the repository registry settings or when the registry was manually or
automatically reload.

  • Participants
  • Parent commits 6f24418
  • Branches stable

Comments (0)

Files changed (1)

File 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):
+    def setActiveTabRepo(self, root=None):
         """"
         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
         """
-        root = hglib.fromunicode(root)
-        if self._activeTabRepo:
-            self._activeTabRepo.setActive(False)
-        m = self.tview.model()
-        it = m.getRepoItem(root, lookForSubrepos=True)
+        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
         if it:
             self._activeTabRepo = it
             it.setActive(True)