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 backout command

Changeset 32378ed2c362

Parent d7d094a45145

by Steve Borho

Changes to 2 files · Browse files at 32378ed2c362 Showing diff from parent d7d094a45145 Diff from another changeset...

Change 1 of 3 Show Entire File hggtk/​backout.py Stacked
 
22
23
24
 
25
26
27
 
78
79
80
 
 
 
 
81
82
83
 
102
103
104
 
 
105
106
107
 
22
23
24
25
26
27
28
 
79
80
81
82
83
84
85
86
87
88
 
107
108
109
110
111
112
113
114
@@ -22,6 +22,7 @@
  self.root = root   self.set_title('Backout changeset - ' + rev)   self.set_default_size(600, 400) + self.notify_func = None     self.tbar = gtk.Toolbar()   self.tips = gtk.Tooltips() @@ -78,6 +79,10 @@
  def _close_clicked(self, toolbutton, data=None):   self.destroy()   + def set_notify_func(self, func, *args): + self.notify_func = func + self.notify_args = args +   def _btn_rev_clicked(self, button):   """ select revision from history dialog """   rev = histselect.select(self.root) @@ -102,6 +107,8 @@
  dlg.show_all()   dlg.run()   dlg.hide() + if self.notify_func: + self.notify_func(self.notify_args)    def run(root='', **opts):   # This dialog is intended to be launched by the changelog browser
Change 1 of 2 Show Entire File hggtk/​history.py Stacked
 
316
317
318
 
319
320
321
 
386
387
388
 
 
 
 
 
 
 
 
 
 
 
 
389
390
391
 
316
317
318
319
320
321
322
 
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
@@ -316,6 +316,7 @@
  _menu.append(create_menu('mark rev for diff', self._mark_rev))   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))   _menu.show_all()   return _menu   @@ -386,6 +387,18 @@
    return vbox   + def _backout_rev(self, menuitem): + from backout import BackoutDialog + rev = self.currow[treemodel.REVID] + rev = short(self.repo.changelog.node(rev)) + parents = [x.node() for x in self.repo.workingctx().parents()] + dialog = BackoutDialog(self.repo.root, rev) + dialog.set_transient_for(self) + dialog.show_all() + dialog.set_notify_func(self.checkout_completed, parents) + dialog.present() + dialog.set_transient_for(None) +   def _diff_revs(self, menuitem):   from status import GStatus   from gtools import cmdtable