[PATCH 1 of 2 V2] outgoing: accept revset argument for --rev

Matt Harbison matt_harbison at yahoo.com
Tue Jul 17 09:18:52 CDT 2012


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1342370590 14400
# Node ID ecde35a1af9e326e124a52787dd355c4d24b07e7
# Parent  67b8cca2f12b0e07d8258d357510805c698e2124
outgoing: accept revset argument for --rev

There may be a more generic way that would add revset support to more commands
by adding revset support to addbranchrevs(), but given the proximity of the next
code freeze, a minimal change seems like the better choice.

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -518,7 +518,7 @@
     ui.status(_('comparing with %s\n') % util.hidepassword(dest))
     revs, checkout = addbranchrevs(repo, repo, branches, opts.get('rev'))
     if revs:
-        revs = [repo.lookup(rev) for rev in revs]
+        revs = [repo.lookup(rev) for rev in scmutil.revrange(repo, revs)]
 
     other = peer(repo, opts, dest)
     outgoing = discovery.findcommonoutgoing(repo, other, revs,
diff --git a/tests/test-phases.t b/tests/test-phases.t
--- a/tests/test-phases.t
+++ b/tests/test-phases.t
@@ -112,7 +112,7 @@
   2 draft C
   3 draft D
   6 draft B'
-  $ hg outgoing -r default ../push-dest --template='{rev} {phase} {desc|firstline}\n'
+  $ hg outgoing -r 'branch(default)' ../push-dest --template='{rev} {phase} {desc|firstline}\n'
   comparing with ../push-dest
   searching for changes
   0 public A


More information about the Mercurial-devel mailing list