changeset 25928:4ee4f7415095

revrange: evaluate all revset specs at once This provides an opportunity for revset to optimize given expressions. For example, "-r0 -r1 -r2" can be optimized to "_list(0 1 2)".
author Yuya Nishihara <yuya@tcha.org>
date Sun, 05 Jul 2015 12:35:42 +0900
parents 44da63623fca
children 289149111d46
files mercurial/scmutil.py
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/scmutil.py	Fri Aug 07 21:39:38 2015 +0900
+++ b/mercurial/scmutil.py	Sun Jul 05 12:35:42 2015 +0900
@@ -720,14 +720,13 @@
 
 def revrange(repo, revs):
     """Yield revision as strings from a list of revision specifications."""
-    subsets = []
+    allspecs = []
     for spec in revs:
         if isinstance(spec, int):
             spec = revset.formatspec('rev(%d)', spec)
-        m = revset.match(repo.ui, spec, repo)
-        subsets.append(m(repo))
-
-    return revset._combinesets(subsets)
+        allspecs.append(spec)
+    m = revset.matchany(repo.ui, allspecs, repo)
+    return m(repo)
 
 def expandpats(pats):
     '''Expand bare globs when running on windows.