Commits

Anonymous committed 0b1377c

workbench: do not reopen repos during startup until subrepos have been loaded into the registry (closes #1017)

During startup the workbench gets the list of repos (and subrepos) that were
open on the last session. It goes through the list, opening them one by one, and
if any is not found on the registry, it adds it automatically adds it to the
reporegistry default group.

Before this patch, the reload operation was performed before the subrepos had
been loaded into the registry. Thus if a subrepo was on the reopen list it would
never be found on the registry, and thus it would always be added to the default
group on startup.

This patch simply changes the order in which the settings are read. The "Save
open repositories on exit" setting is read after the "Show subrepos" setting has
been read and acted upon.

Comments (0)

Files changed (1)

tortoisehg/hgqt/workbench.py

         # Create the actions that will be displayed on the context menu
         self.createActions()
         self.lastClosedRepoRootList = []
-        
+
     def setupUi(self):
         desktopgeom = qApp.desktop().availableGeometry()
         self.resize(desktopgeom.size() * 0.8)
         wb = "Workbench/"
         self.restoreGeometry(s.value(wb + 'geometry').toByteArray())
         self.restoreState(s.value(wb + 'windowState').toByteArray())
-        save = s.value(wb + 'saveRepos').toBool()
-        self.actionSaveRepos.setChecked(save)
-        for path in hglib.fromunicode(s.value(wb + 'openrepos').toString()).split(','):
-            self._openRepo(path, False)
 
         # Load the repo registry settings. Note that we must allow the
         # repo registry to assemble itself before toggling its settings
         # Manually reload the model now, to apply the settings
         self.reporegistry.reloadModel()
 
+        save = s.value(wb + 'saveRepos').toBool()
+        self.actionSaveRepos.setChecked(save)
+        for path in hglib.fromunicode(s.value(wb + 'openrepos').toString()).split(','):
+            self._openRepo(path, False)
+
         # Allow repo registry to assemble itself before toggling path state
         sp = s.value(wb + 'showPaths').toBool()
         QTimer.singleShot(0, lambda: self.actionShowPaths.setChecked(sp))