[PATCH] phase: accept old style revision specification

pierre-yves.david at logilab.fr pierre-yves.david at logilab.fr
Mon Jan 30 11:11:52 CST 2012


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at logilab.fr>
# Date 1327943217 -3600
# Branch stable
# Node ID 8b696621d90a50648076c22591225ab38691390e
# Parent  e2fe1f1f0fdf1b3328d00efdb8af039480a3854d
phase: accept old style revision specification

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4224,21 +4224,24 @@ def phase(ui, repo, *revs, **opts):
     revs = list(revs)
     revs.extend(opts['rev'])
     if not revs:
         raise util.Abort(_('no revisions specified'))
 
+    revs = scmutil.revrange(repo, revs)
+
     lock = None
     ret = 0
     if targetphase is None:
         # display
-        for ctx in repo.set('%lr', revs):
+        for r in revs:
+            ctx = repo[r]
             ui.write('%i: %s\n' % (ctx.rev(), ctx.phasestr()))
     else:
         lock = repo.lock()
         try:
             # set phase
-            nodes = [ctx.node() for ctx in repo.set('%lr', revs)]
+            nodes = [ctx.node() for ctx in repo.set('%ld', revs)]
             if not nodes:
                 raise util.Abort(_('empty revision set'))
             olddata = repo._phaserev[:]
             phases.advanceboundary(repo, targetphase, nodes)
             if opts['force']:


More information about the Mercurial-devel mailing list