diff mercurial/cmdutil.py @ 20364:a6cf48b2880d

revset: added baseset class (still empty) to improve revset performance This class is going to be used to cache the set that is created from this list in many cases while evaluating a revset.
author Lucas Moscovicz <lmoscovicz@fb.com>
date Tue, 21 Jan 2014 11:39:26 -0800
parents 6d4fda48b4e3
children d4f804caa0ed
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Mon Feb 03 21:34:13 2014 +0100
+++ b/mercurial/cmdutil.py	Tue Jan 21 11:39:26 2014 -0800
@@ -1132,7 +1132,7 @@
     elif follow:
         revs = repo.revs('reverse(:.)')
     else:
-        revs = list(repo)
+        revs = revset.baseset(repo)
         revs.reverse()
     if not revs:
         return []
@@ -1140,6 +1140,7 @@
     slowpath = match.anypats() or (match.files() and opts.get('removed'))
     fncache = {}
     change = repo.changectx
+    revs = revset.baseset(revs)
 
     # First step is to fill wanted, the set of revisions that we want to yield.
     # When it does not induce extra cost, we also fill fncache for revisions in
@@ -1471,10 +1472,11 @@
         if follow and len(repo) > 0:
             revs = repo.revs('reverse(:.)')
         else:
-            revs = list(repo.changelog)
+            revs = revset.baseset(repo.changelog)
             revs.reverse()
     if not revs:
         return [], None, None
+    revs = revset.baseset(revs)
     expr, filematcher = _makegraphlogrevset(repo, pats, opts, revs)
     if possiblyunsorted:
         revs.sort(reverse=True)