[PATCH] repowidget: add multipe-revision "go to ancestor" support

3 views
Skip to first unread message

Angel Ezquerra

unread,
Jul 30, 2012, 11:20:29 AM7/30/12
to thg...@googlegroups.com
# 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),
thg.patch

Angel Ezquerra

unread,
Jul 31, 2012, 1:42:35 AM7/31/12
to thg...@googlegroups.com
On Mon, Jul 30, 2012 at 5:20 PM, Angel Ezquerra
<angel.e...@gmail.com> wrote:
> # 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.
>

The title of this patch has a typo ("multipe" rather than "multiple").

Sorry about that,

Angel

Yuya Nishihara

unread,
Aug 3, 2012, 10:35:14 AM8/3/12
to thg...@googlegroups.com
On Tue, 31 Jul 2012 07:42:35 +0200, Angel Ezquerra wrote:
> On Mon, Jul 30, 2012 at 5:20 PM, Angel Ezquerra
> <angel.e...@gmail.com> wrote:
> > # 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.

Pushed to default, thanks.
Reply all
Reply to author
Forward
0 new messages