Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.1, 2.1.1, and 2.1.2

mq: replace "push selected" action with "reorder patches"

- "reorder patches" is more versatile than "push selected" (aka "qpush --move")
- IMHO it makes more sense to have "reorder patches" in the mq widget than in
the patch context menu of the repowidget, since "reorder patches" acts on the
queue as a whole, not on a selected patch
- "qpush --move" is still available in the patch context menu of the repowidget
- As it happens, the "push selected" action in mq.py previously (mis)used the
hg-qreorder icon. Now, the action fits with the icon :-)

TODO: Remove "reorder patches" action from the patch context menu of the
repowidget.

Changeset 68b7ed714324

Parent 69994110b0f4

by Adrian Buehlmann

Changes to one file · Browse files at 68b7ed714324 Showing diff from parent 69994110b0f4 Diff from another changeset...

 
19
20
21
22
 
23
24
25
 
91
92
93
94
95
96
 
 
 
97
98
99
 
112
113
114
115
 
116
117
118
 
191
192
193
194
 
195
196
197
 
349
350
351
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
352
353
354
 
435
436
437
438
439
440
441
442
443
444
445
 
639
640
641
642
643
644
645
 
19
20
21
 
22
23
24
25
 
91
92
93
 
 
 
94
95
96
97
98
99
 
112
113
114
 
115
116
117
118
 
191
192
193
 
194
195
196
197
 
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
 
455
456
457
 
458
459
460
 
461
462
463
 
657
658
659
 
660
661
662
@@ -19,7 +19,7 @@
 from tortoisehg.util import hglib, patchctx  from tortoisehg.hgqt.i18n import _  from tortoisehg.hgqt import qtlib, cmdui, rejects, commit, qscilib -from tortoisehg.hgqt import qqueue, fileview, thgimport +from tortoisehg.hgqt import qqueue, qreorder, fileview, thgimport  from tortoisehg.hgqt.qtlib import geticon    # TODO @@ -91,9 +91,9 @@
  self.setGuardsAct = a = QAction(   geticon('hg-qguard'), _('Guards'), self)   a.setToolTip(_('Configure guards for selected patch')) - self.qpushMoveAct = a = QAction( - geticon('hg-qreorder'), _('Push selected'), self) - a.setToolTip(_('Apply selected patch next (change queue order)')) + self.qreorderAct = a = QAction( + geticon('hg-qreorder'), _('Reorder patches'), self) + a.setToolTip(_('Reorder patches'))   self.qdeleteAct = a = QAction(   geticon('hg-qdelete'), _('Delete'), self)   a.setToolTip(_('Delete selected patches')) @@ -112,7 +112,7 @@
  tbar.addAction(self.qpopAct)   tbar.addAction(self.qpopAllAct)   tbar.addSeparator() - tbar.addAction(self.qpushMoveAct) + tbar.addAction(self.qreorderAct)   tbar.addSeparator()   tbar.addAction(self.qdeleteAct)   tbar.addSeparator() @@ -191,7 +191,7 @@
  self.queueListWidget.itemChanged.connect(self.onRenamePatch)   self.qpushAllAct.triggered.connect(self.onPushAll)   self.qpushAct.triggered.connect(self.onPush) - self.qpushMoveAct.triggered.connect(self.onPushMove) + self.qreorderAct.triggered.connect(self.onQreorder)   self.qpopAllAct.triggered.connect(self.onPopAll)   self.qpopAct.triggered.connect(self.onPop)   self.setGuardsAct.triggered.connect(self.onGuardConfigure) @@ -349,6 +349,26 @@
  self.finishfunc = self.checkForRejects   self.cmd.run(cmdline)   + def onQreorder(self): + if self.cmd.running(): + return + def checkGuardsOrComments(): + cont = True + for p in self.repo.mq.full_series: + if '#' in p: + cont = QuestionMsgBox('Confirm qreorder', + _('<p>ATTENTION!<br>' + 'Guard or comment found.<br>' + 'Reordering patches will destroy them.<br>' + '<br>Continue?</p>'), parent=self, + defaultbutton=QMessageBox.No) + break + return cont + if checkGuardsOrComments(): + dlg = qreorder.QReorderDialog(self.repo, self) + dlg.finished.connect(dlg.deleteLater) + dlg.exec_() +   @pyqtSlot()   def onGuardConfigure(self):   item = self.queueListWidget.currentItem() @@ -435,11 +455,9 @@
  patch = self.queueListWidget.item(row)._thgpatch   applied = set([p.name for p in self.repo.mq.applied])   self.qdeleteAct.setEnabled(patch not in applied) - self.qpushMoveAct.setEnabled(patch not in applied)   self.setGuardsAct.setEnabled(True)   else:   self.qdeleteAct.setEnabled(False) - self.qpushMoveAct.setEnabled(False)   self.setGuardsAct.setEnabled(False)     @pyqtSlot(int) @@ -639,7 +657,6 @@
    self.qpushAllAct.setEnabled(bool(repo.thgmqunappliedpatches))   self.qpushAct.setEnabled(bool(repo.thgmqunappliedpatches)) - self.qpushMoveAct.setEnabled(False)   self.qdeleteAct.setEnabled(False)   self.setGuardsAct.setEnabled(False)   self.qpopAct.setEnabled(bool(applied))