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: re-introduce a special bundle menu

* this allows us to pull revisions from the bundle itself
* this allows us to remove the revision and its parents from the incoming revset
* this prevents the usual menu options from being used on non-existing revisions

Changeset 27c0263a2080

Parent cccdfec18d58

by Steve Borho

Changes to one file · Browse files at 27c0263a2080 Showing diff from parent cccdfec18d58 Diff from another changeset...

 
330
331
332
 
 
 
 
 
 
 
 
 
 
 
 
 
 
333
334
335
 
416
417
418
 
419
420
421
 
752
753
754
 
 
 
 
 
 
755
756
757
 
1001
1002
1003
 
 
 
 
 
 
 
 
 
 
 
1004
1005
1006
 
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
 
430
431
432
433
434
435
436
 
767
768
769
770
771
772
773
774
775
776
777
778
 
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
@@ -330,6 +330,20 @@
  self.syncDemand.pullBundle(self.bundle, None)   self.clearBundle()   + def pullBundleToRev(self): + self.taskTabsWidget.setCurrentIndex(self.syncTabIndex) + self.syncDemand.pullBundle(self.bundle, self.rev) + removed = [self.repo[self.rev]] + while removed: + ctx = removed.pop() + if ctx.node() in self.revset: + self.revset.remove(ctx.node()) + removed.extend(ctx.parents()) + self.repomodel.revset = self.revset + if not self.revset: + self.clearBundle() + self.refresh() +   def rejectBundle(self):   self.clearBundle()   self.reload() @@ -416,6 +430,7 @@
  self.generatePairMenu()   self.generateUnappliedPatchMenu()   self.generateMultipleSelectionMenu() + self.generateBundleMenu()     def dragEnterEvent(self, event):   paths = [unicode(u.toLocalFile()) for u in event.mimeData().urls()] @@ -752,6 +767,12 @@
    if len(selection) == 0:   return + + if self.bundle: + if len(selection) == 1: + self.bundlemenu.exec_(point) + return +   allunapp = False   if 'mq' in self.repo.extensions():   for rev in selection: @@ -1001,6 +1022,17 @@
  menu.addAction(a)   self.multicmenu = menu   + def generateBundleMenu(self): + menu = QMenu(self) + for name, cb in ( + (_('Pull to here...'), self.pullBundleToRev), + (_('Visual diff...'), self.visualDiffRevision), + ): + a = QAction(name, self) + a.triggered.connect(cb) + menu.addAction(a) + self.bundlemenu = menu +   def exportRevisions(self, revisions):   if not revisions:   revisions = [self.rev]