Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9.3, 2.0, and 2.0.1

stable repowidget: add qpush --move option for pushable unapplied patches not qnext

Changeset 245bbfcfcec6

Parent 2e0bb0be6a73

by Steve Borho

Changes to one file · Browse files at 245bbfcfcec6 Showing diff from parent 2e0bb0be6a73 Diff from another changeset...

 
831
832
833
834
 
835
836
 
837
838
 
 
 
 
839
840
841
842
843
 
 
 
 
 
 
844
845
846
 
1017
1018
1019
 
1020
1021
1022
 
1199
1200
1201
 
 
 
 
 
 
 
 
1202
1203
1204
 
831
832
833
 
834
835
 
836
837
838
839
840
841
842
843
 
 
 
 
844
845
846
847
848
849
850
851
852
 
1023
1024
1025
1026
1027
1028
1029
 
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
@@ -831,16 +831,22 @@
    def unappliedPatchMenu(self, point, selection):   q = self.repo.mq - start = q.series_end() + ispushable = False   unapplied = 0 - for i in xrange(start, len(q.series)): + for i in xrange(q.series_end(), len(q.series)):   pushable, reason = q.pushable(i)   if pushable: + if unapplied == 0: + qnext = q.series[i] + if self.rev == q.series[i]: + ispushable = True   unapplied += 1 - self.unappacts[0].setEnabled(len(selection) == 1) - self.unappacts[1].setEnabled('qtip' in self.repo.tags()) - self.unappacts[2].setEnabled(True) - self.unappacts[3].setEnabled(unapplied > 1) + self.unappacts[0].setEnabled(ispushable and len(selection) == 1) + self.unappacts[1].setEnabled(ispushable and len(selection) == 1 and \ + self.rev != qnext) + self.unappacts[2].setEnabled('qtip' in self.repo.tags()) + self.unappacts[3].setEnabled(True) + self.unappacts[4].setEnabled(unapplied > 1)   self.unappcmenu.exec_(point)     def generateSingleMenu(self): @@ -1017,6 +1023,7 @@
  acts = []   for name, cb in (   (_('QGoto'), self.qgotoRevision), + (_('QPush --move'), self.qpushMoveRevision),   (_('Fold patches...'), qfoldact),   (_('Delete patches...'), qdeleteact),   (_('Reorder patches...'), qreorderact)): @@ -1199,6 +1206,14 @@
  cmdline = ['qgoto', str(patchname), '--repository', self.repo.root]   self.runCommand(_('QGoto - TortoiseHg'), cmdline)   + def qpushMoveRevision(self): + """Make REV the top applied patch""" + ctx = self.repo.changectx(self.rev) + patchname = self.repo.changectx(self.rev).thgmqpatchname() + cmdline = ['qpush', '--move', str(patchname), + '--repository', self.repo.root] + self.runCommand(_('QPush --move - TortoiseHg'), cmdline) +   def runCommand(self, title, cmdline):   if self.runner:   InfoMsgBox(_('Unable to start'),