revset: hook into revrange
authorMatt Mackall <mpm@selenic.com>
Tue, 01 Jun 2010 11:18:57 -0500
changeset 11277 2698a95f3f1b
parent 11276 f28b58e35768
child 11278 7df88cdf47fd
revset: hook into revrange
mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Tue Jun 01 11:18:57 2010 -0500
+++ b/mercurial/cmdutil.py	Tue Jun 01 11:18:57 2010 -0500
@@ -10,7 +10,7 @@
 import os, sys, errno, re, glob, tempfile
 import util, templater, patch, error, encoding, templatekw
 import match as _match
-import similar
+import similar, revset
 
 revrangesep = ':'
 
@@ -149,7 +149,13 @@
 
     seen, l = set(), []
     for spec in revs:
-        if revrangesep in spec:
+        if spec and not (
+            spec.startswith(revrangesep) or spec.endswith(revrangesep)):
+            m = revset.match(spec)
+            for r in m(repo, range(len(repo))):
+                l.append(r)
+            seen.update(l)
+        elif revrangesep in spec:
             start, end = spec.split(revrangesep, 1)
             start = revfix(repo, start, 0)
             end = revfix(repo, end, len(repo) - 1)