Source

thg-qt-mq / wb-restore-notabchange.diff

Full commit
# HG changeset patch
# Parent cab4852dedfb75c6aa95335cf197eaf8813e1571
workbench: don't flicker current tabs while restoring last session

It avoids switching current tab for each saved repo, which requires extra
rendering cost and slows down startup.

Also changed to ignore missing repositories, which may happen in ordinary use.

diff --git a/tortoisehg/hgqt/workbench.py b/tortoisehg/hgqt/workbench.py
--- a/tortoisehg/hgqt/workbench.py
+++ b/tortoisehg/hgqt/workbench.py
@@ -1020,7 +1020,11 @@ class Workbench(QMainWindow):
                           _('Reopening repository %s') % upath, '',
                           len(openrepos))
             QCoreApplication.processEvents()
-            self._openRepo(hglib.fromunicode(upath), False)
+            try:
+                repo = thgrepo.repository(path=hglib.fromunicode(upath))
+                self.addRepoTab(repo, bundle=None)
+            except RepoError:
+                pass  # just ignore missing repository
             QCoreApplication.processEvents()
         self.progress(_('Reopening tabs'), None, '', '', None)