Angel Ezquerra  committed 8068c35

workbench: clear previous session open repo list and last active respo on startup

This patch clears the "openrepos" list (and the "lastactiverepo" value) when
the previous session is restored. This ensures that opening a new workbench
window when there is already an existing workbench window will not reopen the
repos that were open on the previous session again. Instead a new, empty
workbench window will be open.

Note that if the first workbench window was open with a "root" path, that
root path will be open on the new workbench window (this was already the case
without this patch).

  • Participants
  • Parent commits 844b807
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/

         if lastactiverepo != '':
             self._openRepo(lastactiverepo, True)
+        # Clear the lastactiverepo and the openrepos list once the workbench state
+        # has been reload, so that opening additional workbench windows does not
+        # reopen these repos again
+        s.setValue(wb + 'openrepos', '')
+        s.setValue(wb + 'lastactiverepo', '')
         # Allow repo registry to assemble itself before toggling path state
         sp = s.value(wb + 'showPaths').toBool()
         QTimer.singleShot(0, lambda: self.actionShowPaths.setChecked(sp))