1. Yuya Nishihara
  2. thg-qt-mq

Commits

Yuya Nishihara  committed 00f6361

finalize some patch; improve commit description

  • Participants
  • Parent commits a1be949
  • Branches default

Comments (0)

Files changed (8)

File branchallpare.diff

  • Ignore whitespace
-# HG changeset patch
-# Parent b3d8fa2d1d76d60211d30afd3366d61bfa7b4021
-repomodel: change default of branch filter to allparents=False
-
-It resolves the incongruity of the initial state between repomodel and
-repofilter.
-
-Also removed default value from RepoWidget's setBranch(), which is a slot
-for RepoFilterBar.branchChanged.
-
-diff --git a/tortoisehg/hgqt/repomodel.py b/tortoisehg/hgqt/repomodel.py
---- a/tortoisehg/hgqt/repomodel.py
-+++ b/tortoisehg/hgqt/repomodel.py
-@@ -170,7 +170,7 @@ class HgRepoListModel(QAbstractTableMode
-         for branch in sorted(self.repo.branchtags().keys()):
-             self.namedbranch_color(branch)
- 
--    def setBranch(self, branch=None, allparents=True):
-+    def setBranch(self, branch=None, allparents=False):
-         self.filterbranch = branch  # unicode
-         self.invalidateCache()
-         if self.revset and self.filterbyrevset:
-diff --git a/tortoisehg/hgqt/repowidget.py b/tortoisehg/hgqt/repowidget.py
---- a/tortoisehg/hgqt/repowidget.py
-+++ b/tortoisehg/hgqt/repowidget.py
-@@ -994,7 +994,7 @@ class RepoWidget(QWidget):
-             self.taskTabsWidget.tabBar().hide()
- 
-     @pyqtSlot(QString, bool)
--    def setBranch(self, branch, allparents=True):
-+    def setBranch(self, branch, allparents):
-         'Change the branch filter'
-         self.repomodel.setBranch(branch=branch, allparents=allparents)
-         self.titleChanged.emit(self.title())

File no-processevent.diff

View file
  • Ignore whitespace
 # HG changeset patch
-# Parent cc1f67937b49e50e1a060c6cf6831595365260e3
+# Parent fab03ad25b558e6079c68e2e8468fc9ac4e13855
 workbench, reporegistry: drop extra processEvents() at bootup
 
 It isn't ready for user input during bootup sequence. This also reduces
 overhead by 100msec order.
 
+Previously, the main window was invisible during bootup, and any user
+operation was blocked by the modal progress dialog, so it was safe to call
+processEvents().
+
 diff --git a/tortoisehg/hgqt/repotreemodel.py b/tortoisehg/hgqt/repotreemodel.py
 --- a/tortoisehg/hgqt/repotreemodel.py
 +++ b/tortoisehg/hgqt/repotreemodel.py

File repow-noubranch.diff

  • Ignore whitespace
-# HG changeset patch
-# Parent 97fa9fa288576ce7585f5c7b4649ed887f493387
-repowidget: don't duplicate filter branch name
-
-diff --git a/tortoisehg/hgqt/repowidget.py b/tortoisehg/hgqt/repowidget.py
---- a/tortoisehg/hgqt/repowidget.py
-+++ b/tortoisehg/hgqt/repowidget.py
-@@ -70,7 +70,6 @@ class RepoWidget(QWidget):
-         repo.repositoryDestroyed.connect(self.repositoryDestroyed)
-         repo.configChanged.connect(self.configChanged)
-         self.revsetfilter = False
--        self.ubranch = u''
-         self.bundle = None  # bundle file name [local encoding]
-         self.bundlesource = None  # source URL of incoming bundle [unicode]
-         self.outgoingMode = False
-@@ -271,8 +270,8 @@ class RepoWidget(QWidget):
-         """Returns the expected title for this widget [unicode]"""
-         if self.bundle:
-             return _('%s <incoming>') % self.repo.shortname
--        elif self.ubranch:
--            return u'%s [%s]' % (self.repo.shortname, self.ubranch)
-+        elif self.repomodel.branch():
-+            return u'%s [%s]' % (self.repo.shortname, self.repomodel.branch())
-         else:
-             return self.repo.shortname
- 
-@@ -781,7 +780,7 @@ class RepoWidget(QWidget):
-         # Filter revision set in case revisions were removed
-         self.revset = [r for r in self.revset if r < len(self.repo)]
-         self.repomodel = HgRepoListModel(self.repo, self.repoview.colselect[0],
--                                         self.ubranch, self.revset,
-+                                         self.filterbar.branch(), self.revset,
-                                          self.revsetfilter, self)
-         self.repomodel.filled.connect(self.modelFilled)
-         self.repomodel.loaded.connect(self.modelLoaded)
-@@ -997,7 +996,6 @@ class RepoWidget(QWidget):
-     @pyqtSlot(QString, bool)
-     def setBranch(self, branch, allparents=True):
-         'Change the branch filter'
--        self.ubranch = branch
-         self.repomodel.setBranch(branch=branch, allparents=allparents)
-         self.titleChanged.emit(self.title())
-         if self.revset:

File savebranch.diff

  • Ignore whitespace
-# HG changeset patch
-# Parent 5612fbdeaa90d65b807496c1b6971ac3fb54444c
-repofilter: restore previously selected branch (closes #1009, #1927)
-
-diff --git a/tortoisehg/hgqt/repofilter.py b/tortoisehg/hgqt/repofilter.py
---- a/tortoisehg/hgqt/repofilter.py
-+++ b/tortoisehg/hgqt/repofilter.py
-@@ -200,6 +200,10 @@ class RepoFilterBar(QToolBar):
-         self.revsetcombo.addItems(full)
-         self.revsetcombo.setCurrentIndex(-1)
- 
-+        self._branchReloading = True
-+        self.setBranch(s.value('revset/' + repoid + '/branch').toString())
-+        self._branchReloading = False
-+
-         # Show the filter bar if necessary
-         if s.value('revset/' + repoid + '/showrepofilterbar').toBool():
-             self.show()
-@@ -215,6 +219,7 @@ class RepoFilterBar(QToolBar):
-         s.setValue('revset/' + repoid + '/queries', self.revsethist)
-         s.setValue('revset/' + repoid + '/filter', self.filtercb.isChecked())
-         s.setValue('revset/' + repoid + '/showrepofilterbar', not self.isHidden())
-+        s.setValue('revset/' + repoid + '/branch', self.branch())
- 
-     def _initbranchfilter(self):
-         self._branchLabel = QToolButton(

File series

View file
  • Ignore whitespace
-sortbranch.diff
-repow-noubranch.diff
-branchallpare.diff
-savebranch.diff
-wb-title.diff
 reporeg-moveactions.diff
 reporeg-saverestore.diff
 reporeg-actdict.diff

File sortbranch.diff

  • Ignore whitespace
-# HG changeset patch
-# Parent 6c42545dbd88959fd014c74a69b09cdf3eacaa7c
-repofilter: show current working branch first (closes #2042)
-
-If you go feature-branch development, there are many short-term branches,
-which bursts branch combo box. In that case, the current branch will be
-accessed more often, let's give higher priority to it.
-
-diff --git a/tests/widget/repofilterbar_branch_test.py b/tests/widget/repofilterbar_branch_test.py
---- a/tests/widget/repofilterbar_branch_test.py
-+++ b/tests/widget/repofilterbar_branch_test.py
-@@ -24,6 +24,7 @@ class RepoFilterBarBranchTest(unittest.T
-             hg.branch(name)
-             hg.commit('-m', 'create %s branch' % name)
-         hg.commit('--close-branch', '-m', 'close baz branch')
-+        hg.update('foo')  # current branch will be listed first
-         cls.repo = thgrepo.repository(path=hg.path)
- 
-     @classmethod
-@@ -45,7 +46,7 @@ class RepoFilterBarBranchTest(unittest.T
- 
-     def test_open_branches(self):
-         self.assertEqual([self.widget._allBranchesLabel,
--                          'default', 'bar', 'foo'],
-+                          'foo', 'default', 'bar'],
-                          _listitems(self.widget._branchCombo))
-         self.assertTrue(self.widget._branchCombo.isEnabled())
-         self.assertFalse(self.branchchanged.called)
-@@ -54,7 +55,7 @@ class RepoFilterBarBranchTest(unittest.T
-         self.widget._abranchAction.setChecked(False)
-         self.widget._abranchAction.trigger()  # checked
-         self.assertEqual([self.widget._allBranchesLabel,
--                          'bar', 'foo'],
-+                          'foo', 'bar'],
-                          _listitems(self.widget._branchCombo))
-         self.assertTrue(self.widget._branchCombo.isEnabled())
-         self.assertFalse(self.branchchanged.called)
-@@ -63,7 +64,7 @@ class RepoFilterBarBranchTest(unittest.T
-         self.widget._cbranchAction.setChecked(False)
-         self.widget._cbranchAction.trigger()  # checked
-         self.assertEqual([self.widget._allBranchesLabel,
--                          'default', 'bar', 'baz', 'foo'],
-+                         'foo',  'default', 'bar', 'baz'],
-                          _listitems(self.widget._branchCombo))
-         self.assertTrue(self.widget._branchCombo.isEnabled())
-         self.assertFalse(self.branchchanged.called)
-diff --git a/tortoisehg/hgqt/repofilter.py b/tortoisehg/hgqt/repofilter.py
---- a/tortoisehg/hgqt/repofilter.py
-+++ b/tortoisehg/hgqt/repofilter.py
-@@ -256,10 +256,10 @@ class RepoFilterBar(QToolBar):
-         else:
-             branches = self._repo.namedbranches
- 
--        # show the 'default' branch on top, if there is one
--        if 'default' in branches:
--            branches = ['default'] + \
--                [branch for branch in branches if branch != 'default']
-+        # easy access to common branches (Python sorted() is stable)
-+        priomap = {self._repo.dirstate.branch(): -2, 'default': -1}
-+        branches = sorted(branches, key=lambda e: priomap.get(e, 0))
-+
-         self._branchReloading = True
-         self._branchCombo.clear()
-         self._branchCombo.addItem(self._allBranchesLabel)

File wb-restore-notabchange.diff

View file
  • Ignore whitespace
 # HG changeset patch
-# Parent 3e68e2945ec6bc386d3e69ecab9a1ff9ae01f76d
-workbench: don't flicker tabs while restoring last session
+# 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
-@@ -1015,7 +1015,11 @@ class Workbench(QMainWindow):
+@@ -1020,7 +1020,11 @@ class Workbench(QMainWindow):
                            _('Reopening repository %s') % upath, '',
                            len(openrepos))
              QCoreApplication.processEvents()

File wb-title.diff

  • Ignore whitespace
-# HG changeset patch
-# Parent 7cd003706e03805e1182da68235f27f82a2fed20
-workbench: show branch filter name and incoming state in window title
-
-diff --git a/tortoisehg/hgqt/workbench.py b/tortoisehg/hgqt/workbench.py
---- a/tortoisehg/hgqt/workbench.py
-+++ b/tortoisehg/hgqt/workbench.py
-@@ -655,21 +655,24 @@ class Workbench(QMainWindow):
-         self.updateTaskViewMenu()
-         self.updateToolBarActions()
-         tw = self.repoTabsWidget
--        w = tw.currentWidget()
-         if ((tw.count() == 0) or
-             ((tw.count() == 1) and
-              not self.ui.configbool('tortoisehg', 'forcerepotab', False))):
-             tw.tabBar().hide()
-         else:
-             tw.tabBar().show()
-+        self._updateWindowTitle()
-+
-+    def _updateWindowTitle(self):
-+        tw = self.repoTabsWidget
-+        w = tw.currentWidget()
-         if tw.count() == 0:
-             self.setWindowTitle(_('TortoiseHg Workbench'))
-         elif w.repo.shortname != w.repo.displayname:
-             self.setWindowTitle(_('%s - TortoiseHg Workbench - %s') %
--                                (w.repo.shortname, w.repo.displayname))
-+                                (w.title(), w.repo.displayname))
-         else:
--            self.setWindowTitle(_('%s - TortoiseHg Workbench') %
--                                w.repo.shortname)
-+            self.setWindowTitle(_('%s - TortoiseHg Workbench') % w.title())
- 
-     def updateToolBarActions(self):
-         w = self.repoTabsWidget.currentWidget()
-@@ -762,6 +765,13 @@ class Workbench(QMainWindow):
-         self.log.setRepository(repo)
-         self.mqpatches.setrepo(repo)
- 
-+    @pyqtSlot(unicode)
-+    def _updateRepoTabTitle(self, title):
-+        index = self.repoTabsWidget.indexOf(self.sender())
-+        self.repoTabsWidget.setTabText(index, title)
-+        if index == self.repoTabsWidget.currentIndex():
-+            self._updateWindowTitle()
-+
-     def addRepoTab(self, repo, bundle):
-         '''opens the given repo in a new tab'''
-         rw = RepoWidget(repo, self, bundle=bundle)
-@@ -792,8 +802,7 @@ class Workbench(QMainWindow):
-             index = self.repoTabsWidget.addTab(rw, rw.title())
-         tw.setTabToolTip(index, hglib.tounicode(repo.root))
-         tw.setCurrentIndex(index)
--        rw.titleChanged.connect(
--            lambda title: tw.setTabText(tw.indexOf(rw), title))
-+        rw.titleChanged.connect(self._updateRepoTabTitle)
-         rw.showIcon.connect(
-             lambda icon: tw.setTabIcon(tw.indexOf(rw), icon))
-         self.reporegistry.addRepo(repo.root)