# HG changeset patch
# User Angel Ezquerra <
angel.e...@gmail.com>
# Date 1343593740 -7200
# Node ID fe2fba429f379ceb4097b9520470c97e1a4d150c
# Parent b0d15930286f5f16bfa5af098ba4eff1984d6463
repowidget: add multipe-revision "go to ancestor" support
Up until now the "go to ancestor" menu item was only shown when selecting a pair
of revisions. This patch shows it when selecting more than two revisions as
well.
diff --git a/tortoisehg/hgqt/repowidget.py b/tortoisehg/hgqt/repowidget.py
--- a/tortoisehg/hgqt/repowidget.py
+++ b/tortoisehg/hgqt/repowidget.py
@@ -1336,6 +1336,13 @@
self.singlecmenu = menu
self.singlecmenuitems = items
+ def _gotoAncestor(self):
+ ancestor = self.repo[self.menuselection[0]]
+ for rev in self.menuselection:
+ ctx = self.repo[rev]
+ ancestor = ancestor.ancestor(ctx)
+ self.goto(ancestor.rev())
+
def generatePairMenu(self):
def dagrange():
revA, revB = self.menuselection
@@ -1413,10 +1420,6 @@
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 (
@@ -1434,7 +1437,7 @@
(_('Bisect - Bad, Good...'), bisectReverse, 'hg-bisect-bad-good'),
(_('Compress History...'), compressDlg, 'hg-compress'),
(None, None, None),
- (_('Goto common ancestor'), gotoAncestor, 'hg-merge'),
+ (_('Goto common ancestor'), self._gotoAncestor, 'hg-merge'),
(_('Similar revisions...'), self.matchRevision, 'view-filter'),
(None, None, None),
(_('Graft Selected to local'), self.graftRevisions, None),
@@ -1515,6 +1518,7 @@
(_('Export Selected...'), exportSel, 'hg-export'),
(_('Email Selected...'), emailSel, 'mail-forward'),
(None, None, None),
+ (_('Goto common ancestor'), self._gotoAncestor, 'hg-merge'),
(_('Similar revisions...'), self.matchRevision, 'view-filter'),
(None, None, None),
(_('Graft Selected to local'), self.graftRevisions, None),