Commits

Angel Ezquerra committed b9ebfc7

reporegistry: improve detection of repos that are already open when opening a repo

Sometimes it was possible to open a new repo tab by double clicking on a repo
on the repo registry, even though the repo was already open. This patch improves
the code that looks for existing repo tabs.

Comments (0)

Files changed (1)

tortoisehg/hgqt/workbench.py

 import os
 import sys
 import getpass # used to get the username on the workbench server
-from mercurial import ui
+from mercurial import ui, util
 from mercurial.error import RepoError
 from tortoisehg.util import paths, hglib
 
 
     def _findrepowidget(self, root):
         """Iterates RepoWidget for the specified root"""
+        def normpathandcase(path):
+            return os.path.normcase(util.normpath(path))
         tw = self.repoTabsWidget
         for idx in range(tw.count()):
             rw = tw.widget(idx)
-            if rw.repo.root == root:
+            if normpathandcase(rw.repo.root) == normpathandcase(root):
                 yield rw
 
     def onAbout(self, *args):