Commits

Yuya Nishihara committed 8cd9f52

fin

Comments (0)

Files changed (11)

15280.diff

-# HG changeset patch
-# User Yuya Nishihara <yuya@tcha.org>
-# Date 1381675811 -32400
-#      Sun Oct 13 23:50:11 2013 +0900
-# Node ID a7567a180e739ccd2b744d9ece5a85aa1a5fbeca
-# Parent  c38e7c5c5de7660c0d5a1fcbe4ac614382737402
-mqdock: omit command name from label of 'Unapply Patch' in favor of 5e7ea53f59dd
-
-diff --git a/tortoisehg/hgqt/repowidget.py b/tortoisehg/hgqt/repowidget.py
---- a/tortoisehg/hgqt/repowidget.py
-+++ b/tortoisehg/hgqt/repowidget.py
-@@ -1384,7 +1384,7 @@ class RepoWidget(QWidget):
- 
-         if 'mq' in exs or 'rebase' in exs or 'strip' in exs:
-             submenu = menu.addMenu(_('Modi&fy History'))
--            entry(submenu, 'mq', applied, _('&Unapply Patch (qgoto parent)'), 'hg-qgoto',
-+            entry(submenu, 'mq', applied, _('&Unapply Patch'), 'hg-qgoto',
-                   self.qgotoParentRevision)
-             entry(submenu, 'mq', fixed, _('Import to &MQ'), 'qimport',
-                   self.qimportRevision)

15281.diff

-# HG changeset patch
-# User Yuya Nishihara <yuya@tcha.org>
-# Date 1381842416 -32400
-#      Tue Oct 15 22:06:56 2013 +0900
-# Node ID 29d1b9ef783d5cc6c6d242e2c90e753df30b1dcc
-# Parent  a7567a180e739ccd2b744d9ece5a85aa1a5fbeca
-mqdock: add delete and guard actions to context menu
-
-This menu will have all MQ-related actions defined in RepoWidget.
-
-diff --git a/tortoisehg/hgqt/mq.py b/tortoisehg/hgqt/mq.py
---- a/tortoisehg/hgqt/mq.py
-+++ b/tortoisehg/hgqt/mq.py
-@@ -509,10 +509,10 @@ class MQPatchesWidget(QDockWidget):
-             geticon('hg-qpush'), _('Push', 'MQ QPush'), self)
-         a.setToolTip(_('Apply one patch'))
-         self.setGuardsAct = a = QAction(
--            geticon('hg-qguard'), _('Guards'), self)
-+            geticon('hg-qguard'), _('Set &Guards...'), self)
-         a.setToolTip(_('Configure guards for selected patch'))
-         self.qdeleteAct = a = QAction(
--            geticon('hg-qdelete'), _('Delete'), self)
-+            geticon('hg-qdelete'), _('&Delete Patches...'), self)
-         a.setToolTip(_('Delete selected patches'))
-         self.qpopAct = a = QAction(
-             geticon('hg-qpop'), _('Pop'), self)
-@@ -632,7 +632,9 @@ class MQPatchesWidget(QDockWidget):
-     @pyqtSlot(QPoint)
-     def onMenuRequested(self, pos):
-         menu = QMenu(self)
-+        menu.addAction(self.qdeleteAct)
-         menu.addAction(self.qrenameAct)
-+        menu.addAction(self.setGuardsAct)
-         menu.exec_(self.queueListWidget.viewport().mapToGlobal(pos))
-         menu.setParent(None)
- 

15282.diff

-# HG changeset patch
-# User Yuya Nishihara <yuya@tcha.org>
-# Date 1381847617 -32400
-#      Tue Oct 15 23:33:37 2013 +0900
-# Node ID cd92c9b8a27292f25c1cb10edabea93999b4cbb0
-# Parent 61b9fb2ef79617fbbc508cd6fe6184b72a52e395
-mqdock: simply disable main widget if mq functions are unavailable
-
-diff --git a/tortoisehg/hgqt/mq.py b/tortoisehg/hgqt/mq.py
---- a/tortoisehg/hgqt/mq.py
-+++ b/tortoisehg/hgqt/mq.py
-@@ -710,17 +710,8 @@ class MQPatchesWidget(QDockWidget):
- 
-     @pyqtSlot()
-     def reload(self):
--        if self.repo is None:
--            self.qqueueComboWidget.setEnabled(False)
--            self.qqueueConfigBtn.setEnabled(False)
--            self.guardSelBtn.setEnabled(False)
--            self.qpushAllAct.setEnabled(False)
--            self.qpushAct.setEnabled(False)
--            self.qdeleteAct.setEnabled(False)
--            self.setGuardsAct.setEnabled(False)
--            self.qrenameAct.setEnabled(False)
--            self.qpopAct.setEnabled(False)
--            self.qpopAllAct.setEnabled(False)
-+        self.widget().setEnabled(bool(self._repoagent))
-+        if not self._repoagent:
-             return
- 
-         self.loadQQueues()
-@@ -741,7 +732,6 @@ class MQPatchesWidget(QDockWidget):
-         self.refreshSelectedGuards()
- 
-         self.qqueueComboWidget.setEnabled(self.qqueueComboWidget.count() > 1)
--        self.qqueueConfigBtn.setEnabled(True)
-         self.qpushAllAct.setEnabled(bool(repo.thgmqunappliedpatches))
-         self.qpushAct.setEnabled(bool(repo.thgmqunappliedpatches))
-         self.qdeleteAct.setEnabled(False)

15283.diff

-# HG changeset patch
-# User Yuya Nishihara <yuya@tcha.org>
-# Date 1381847701 -32400
-#      Tue Oct 15 23:35:01 2013 +0900
-# Node ID 743558fcf1174718ac2f23329efc688acc0042a0
-# Parent 4b8005bcd7311158a16c1e30497438df09e06c85
-mqdock: extract method which updates availability of patch actions by selection
-
-diff --git a/tortoisehg/hgqt/mq.py b/tortoisehg/hgqt/mq.py
---- a/tortoisehg/hgqt/mq.py
-+++ b/tortoisehg/hgqt/mq.py
-@@ -682,6 +682,13 @@ class MQPatchesWidget(QDockWidget):
-     #@pyqtSlot(QModelIndex)
-     def onPatchSelected(self, index):
-         'Patch has been selected, update buttons'
-+        self._updatePatchActions()
-+        if index.isValid():
-+            model = self.queueListWidget.model()
-+            self.patchSelected.emit(model.patchName(index))
-+
-+    def _updatePatchActions(self):
-+        index = self.queueListWidget.currentIndex()
-         if index.isValid():
-             model = self.queueListWidget.model()
-             patch = hglib.fromunicode(model.patchName(index))
-@@ -689,7 +696,6 @@ class MQPatchesWidget(QDockWidget):
-             self.qdeleteAct.setEnabled(patch not in applied)
-             self.setGuardsAct.setEnabled(True)
-             self.qrenameAct.setEnabled(True)
--            self.patchSelected.emit(hglib.tounicode(patch))
-         else:
-             self.qdeleteAct.setEnabled(False)
-             self.setGuardsAct.setEnabled(False)

15284.diff

-# HG changeset patch
-# User Yuya Nishihara <yuya@tcha.org>
-# Date 1381848038 -32400
-#      Tue Oct 15 23:40:38 2013 +0900
-# Node ID c07c282207979dc2e585377aa6af6ebd72e689e9
-# Parent 97c6c122e57cb16f121db530ee43441c86b524c9
-mqdock: fix availability of patch actions after reload
-
-It should set enabled flag according to the currently selected patch.
-
-diff --git a/tortoisehg/hgqt/mq.py b/tortoisehg/hgqt/mq.py
---- a/tortoisehg/hgqt/mq.py
-+++ b/tortoisehg/hgqt/mq.py
-@@ -740,9 +740,7 @@ class MQPatchesWidget(QDockWidget):
-         self.qqueueComboWidget.setEnabled(self.qqueueComboWidget.count() > 1)
-         self.qpushAllAct.setEnabled(bool(repo.thgmqunappliedpatches))
-         self.qpushAct.setEnabled(bool(repo.thgmqunappliedpatches))
--        self.qdeleteAct.setEnabled(False)
--        self.setGuardsAct.setEnabled(False)
--        self.qrenameAct.setEnabled(False)
-+        self._updatePatchActions()
-         self.qpopAct.setEnabled(bool(applied))
-         self.qpopAllAct.setEnabled(bool(applied))
- 

15285.diff

-# HG changeset patch
-# User Yuya Nishihara <yuya@tcha.org>
-# Date 1381848289 -32400
-#      Tue Oct 15 23:44:49 2013 +0900
-# Node ID 08d9b23d70574e72b198723f7dcc86312ea46988
-# Parent  c07c282207979dc2e585377aa6af6ebd72e689e9
-mqdock: update qdelete action by applied state of model
-
-Because PatchQueueModel manages applied state of each patch, MQPatchesWidget
-should use it for consistency.
-
-diff --git a/tortoisehg/hgqt/mq.py b/tortoisehg/hgqt/mq.py
---- a/tortoisehg/hgqt/mq.py
-+++ b/tortoisehg/hgqt/mq.py
-@@ -410,6 +410,12 @@ class PatchQueueModel(QAbstractListModel
-             return []
-         return map(hglib.tounicode, self._seriesguards[index.row()])
- 
-+    def isApplied(self, index):
-+        if not index.isValid():
-+            return False
-+        patch = self._series[index.row()]
-+        return self._statusmap.get(patch) == 'applied'
-+
-     def _statusIcon(self, index):
-         assert index.isValid()
-         patch = self._series[index.row()]
-@@ -682,9 +688,7 @@ class MQPatchesWidget(QDockWidget):
-         index = self.queueListWidget.currentIndex()
-         if index.isValid():
-             model = self.queueListWidget.model()
--            patch = hglib.fromunicode(model.patchName(index))
--            applied = set([p.name for p in self.repo.mq.applied])
--            self.qdeleteAct.setEnabled(patch not in applied)
-+            self.qdeleteAct.setEnabled(not model.isApplied(index))
-             self.setGuardsAct.setEnabled(True)
-             self.qrenameAct.setEnabled(True)
-         else:

15286.diff

-# HG changeset patch
-# User Yuya Nishihara <yuya@tcha.org>
-# Date 1381848405 -32400
-#      Tue Oct 15 23:46:45 2013 +0900
-# Node ID bfe55b60392fef9a3b6baf3e5cdb142ad85a4ee7
-# Parent 4b11f790ea68a0aa69ed0b97ced8e0bec1691b95
-mqdock: tidy up method to update patch actions
-
-diff --git a/tortoisehg/hgqt/mq.py b/tortoisehg/hgqt/mq.py
---- a/tortoisehg/hgqt/mq.py
-+++ b/tortoisehg/hgqt/mq.py
-@@ -697,16 +697,12 @@ class MQPatchesWidget(QDockWidget):
- 
-     @pyqtSlot()
-     def _updatePatchActions(self):
-+        model = self.queueListWidget.model()
-         index = self.queueListWidget.currentIndex()
--        if index.isValid():
--            model = self.queueListWidget.model()
--            self.qdeleteAct.setEnabled(not model.isApplied(index))
--            self.setGuardsAct.setEnabled(True)
--            self.qrenameAct.setEnabled(True)
--        else:
--            self.qdeleteAct.setEnabled(False)
--            self.setGuardsAct.setEnabled(False)
--            self.qrenameAct.setEnabled(False)
-+        self.qdeleteAct.setEnabled(index.isValid()
-+                                   and not model.isApplied(index))
-+        self.setGuardsAct.setEnabled(index.isValid())
-+        self.qrenameAct.setEnabled(index.isValid())
- 
-     @pyqtSlot(QString)
-     def onQQueueActivated(self, text):

mq-appliedcnt.diff

-# HG changeset patch
-# Parent 71056d4689aec13d7792d6a3fb15e204a781a166
-mqdock: update qpush/qpop actions by applied and series count of model
-
-It's good for consistency between PatchQueueModel and its actions.
-
-diff --git a/tortoisehg/hgqt/mq.py b/tortoisehg/hgqt/mq.py
---- a/tortoisehg/hgqt/mq.py
-+++ b/tortoisehg/hgqt/mq.py
-@@ -409,6 +409,9 @@ class PatchQueueModel(QAbstractListModel
-             return 0
-         return len(self._series)
- 
-+    def appliedCount(self):
-+        return sum(s == 'applied' for s in self._statusmap.itervalues())
-+
-     def patchName(self, index):
-         if not index.isValid():
-             return ''
-@@ -698,12 +701,13 @@ class MQPatchesWidget(QDockWidget):
-     @pyqtSlot()
-     def _updatePatchActions(self):
-         model = self.queueListWidget.model()
--        repo = self.repo
--        applied = set([p.name for p in repo.mq.applied])
--        self.qpushAllAct.setEnabled(bool(repo.thgmqunappliedpatches))
--        self.qpushAct.setEnabled(bool(repo.thgmqunappliedpatches))
--        self.qpopAct.setEnabled(bool(applied))
--        self.qpopAllAct.setEnabled(bool(applied))
-+
-+        appliedcnt = model.appliedCount()
-+        seriescnt = model.rowCount()
-+        self.qpushAllAct.setEnabled(seriescnt > appliedcnt)
-+        self.qpushAct.setEnabled(seriescnt > appliedcnt)
-+        self.qpopAct.setEnabled(appliedcnt > 0)
-+        self.qpopAllAct.setEnabled(appliedcnt > 0)
- 
-         index = self.queueListWidget.currentIndex()
-         self.qdeleteAct.setEnabled(index.isValid()

mq-laychanged.diff

-# HG changeset patch
-# Date 1381928132 -32400
-# Parent 0d62a8316abfc00db32207e517644e82f74b7684
-mqdock: make sure patch actions catch up changes in model
-
-For example, qpush will update cache of PatchQueueModel and emit dataChanged.
-Then, patch actions should be enabled/disabled accordingly.
-
-diff --git a/tortoisehg/hgqt/mq.py b/tortoisehg/hgqt/mq.py
---- a/tortoisehg/hgqt/mq.py
-+++ b/tortoisehg/hgqt/mq.py
-@@ -624,8 +624,10 @@ class MQPatchesWidget(QDockWidget):
-         if self._repoagent:
-             newmodel = PatchQueueModel(self._repoagent, self)
-             self.queueListWidget.setModel(newmodel)
-+            newmodel.dataChanged.connect(self._updatePatchActions)
-             selmodel = self.queueListWidget.selectionModel()
-             selmodel.currentRowChanged.connect(self.onPatchSelected)
-+            self._updatePatchActions()
-         else:
-             self.queueListWidget.setModel(None)
-         if oldmodel:
-@@ -687,6 +689,7 @@ class MQPatchesWidget(QDockWidget):
-             model = self.queueListWidget.model()
-             self.patchSelected.emit(model.patchName(index))
- 
-+    @pyqtSlot()
-     def _updatePatchActions(self):
-         index = self.queueListWidget.currentIndex()
-         if index.isValid():
-@@ -740,7 +743,6 @@ class MQPatchesWidget(QDockWidget):
-         self.qqueueComboWidget.setEnabled(self.qqueueComboWidget.count() > 1)
-         self.qpushAllAct.setEnabled(bool(repo.thgmqunappliedpatches))
-         self.qpushAct.setEnabled(bool(repo.thgmqunappliedpatches))
--        self._updatePatchActions()
-         self.qpopAct.setEnabled(bool(applied))
-         self.qpopAllAct.setEnabled(bool(applied))
- 

mq-upmove.diff

-# HG changeset patch
-# Parent 0c35458fd926360c8c6606fdf95658d7bac9aead
-mqdock: unify method which updates availability of patch actions
-
-diff --git a/tortoisehg/hgqt/mq.py b/tortoisehg/hgqt/mq.py
---- a/tortoisehg/hgqt/mq.py
-+++ b/tortoisehg/hgqt/mq.py
-@@ -698,6 +698,13 @@ class MQPatchesWidget(QDockWidget):
-     @pyqtSlot()
-     def _updatePatchActions(self):
-         model = self.queueListWidget.model()
-+        repo = self.repo
-+        applied = set([p.name for p in repo.mq.applied])
-+        self.qpushAllAct.setEnabled(bool(repo.thgmqunappliedpatches))
-+        self.qpushAct.setEnabled(bool(repo.thgmqunappliedpatches))
-+        self.qpopAct.setEnabled(bool(applied))
-+        self.qpopAllAct.setEnabled(bool(applied))
-+
-         index = self.queueListWidget.currentIndex()
-         self.qdeleteAct.setEnabled(index.isValid()
-                                    and not model.isApplied(index))
-@@ -728,7 +735,6 @@ class MQPatchesWidget(QDockWidget):
- 
-         repo = self.repo
- 
--        applied = set([p.name for p in repo.mq.applied])
-         self.allguards = set()
-         for idx, patch in enumerate(repo.mq.series):
-             patchguards = repo.mq.seriesguards[idx]
-@@ -741,10 +747,6 @@ class MQPatchesWidget(QDockWidget):
-         self.refreshSelectedGuards()
- 
-         self.qqueueComboWidget.setEnabled(self.qqueueComboWidget.count() > 1)
--        self.qpushAllAct.setEnabled(bool(repo.thgmqunappliedpatches))
--        self.qpushAct.setEnabled(bool(repo.thgmqunappliedpatches))
--        self.qpopAct.setEnabled(bool(applied))
--        self.qpopAllAct.setEnabled(bool(applied))
- 
-     def loadQQueues(self):
-         repo = self.repo
-15280.diff
-15281.diff
-15282.diff
-15283.diff
-15284.diff
-mq-laychanged.diff
-15285.diff
-15286.diff
-mq-upmove.diff
-mq-appliedcnt.diff
 ci-checked.diff
 cmdui-height.diff
 cmdui-mark-setlogvisible.diff