Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.4rc1, 0.4rc2, and 0.4rc3

hggtk/history: add context menu option for strip command

Changeset 4a7e4c529c40

Parent 32378ed2c362

by Steve Borho

Changes to one file · Browse files at 4a7e4c529c40 Showing diff from parent 32378ed2c362 Diff from another changeset...

Change 1 of 3 Show Entire File hggtk/​history.py Stacked
 
14
15
16
17
 
18
19
20
21
22
23
24
 
317
318
319
 
 
 
 
 
 
 
320
321
322
 
387
388
389
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
390
391
392
 
14
15
16
 
17
18
19
20
 
21
22
23
 
316
317
318
319
320
321
322
323
324
325
326
327
328
 
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
@@ -14,11 +14,10 @@
 import StringIO    from mercurial.node import * -from mercurial import ui, hg, commands +from mercurial import ui, hg, commands, extensions  from gdialog import *  from changeset import ChangeSet  from logfilter import FilterDialog -from hgcmd import CmdDialog  from update import UpdateDialog  from merge import MergeDialog  from vis import treemodel @@ -317,6 +316,13 @@
  self._cmenu_diff = create_menu('_diff with mark', self._diff_revs)   _menu.append(self._cmenu_diff)   _menu.append(create_menu('backout revision', self._backout_rev)) + try: + # Ensure mq extension is loaded + extensions.loadall(self.ui) + extensions.find('mq') + _menu.append(create_menu('strip revision', self._strip_rev)) + except KeyError: + pass   _menu.show_all()   return _menu   @@ -387,6 +393,21 @@
    return vbox   + def _strip_rev(self, menuitem): + rev = self.currow[treemodel.REVID] + res = Confirm('Strip Revision(s)', [], self, + 'Remove revision %d and all descendants?' % rev).run() + if res != gtk.RESPONSE_YES: + return + from hgcmd import CmdDialog + cmdline = ['hg', 'strip', str(rev)] + dlg = CmdDialog(cmdline) + dlg.show_all() + dlg.run() + dlg.hide() + self.repo.invalidate() + self.reload_log() +   def _backout_rev(self, menuitem):   from backout import BackoutDialog   rev = self.currow[treemodel.REVID]