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)".
--- 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.