Discussion:
[thg-dev] [PATCH] repowidget: add "Goto common ancestor" command in pop-up menu
Sune Foldager
2011-11-17 12:43:34 UTC
Permalink
# HG changeset patch
# User Sune Foldager <***@cyanite.org>
# Date 1321533672 -3600
# Node ID 3ad0d7fc51750144ae26474b03d7aa64959d29cb
# Parent af5661455dc53e9345d11b0955d005ce7317523b
repowidget: add "Goto common ancestor" command in pop-up menu

This augments the hidden middle-mouse-button gesture with the same function.

diff -r af5661455dc5 -r 3ad0d7fc5175 tortoisehg/hgqt/repowidget.py
--- a/tortoisehg/hgqt/repowidget.py Thu Nov 17 11:10:34 2011 +0100
+++ b/tortoisehg/hgqt/repowidget.py Thu Nov 17 13:41:12 2011 +0100
@@ -1302,6 +1302,10 @@
dlg = compress.CompressDialog(self.repo, revs, self)
dlg.finished.connect(dlg.deleteLater)
dlg.exec_()
+ def gotoAncestor():
+ ctxa = self.repo[self.menuselection[0]]
+ ctxb = self.repo[self.menuselection[1]]
+ self.goto(ctxa.ancestor(ctxb).rev())

menu = QMenu(self)
for name, cb, icon in (
@@ -1317,7 +1321,9 @@
(None, None, None),
(_('Bisect - Good, Bad...'), bisectNormal, 'hg-bisect-good-bad'),
(_('Bisect - Bad, Good...'), bisectReverse, 'hg-bisect-bad-good'),
- (_('Compress History...'), compressDlg, 'hg-compress')
+ (_('Compress History...'), compressDlg, 'hg-compress'),
+ (None, None, None),
+ (_('Goto common ancestor'), gotoAncestor, 'hg-merge')
):
if name is None:
menu.addSeparator()

Loading...