revset-ancestorspec: call 'getset' on a 'fullreposet'
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 16 Oct 2014 23:11:25 -0700
changeset 23163 6f1b8b3f12fd
parent 23162 69524a05a7fa
child 23164 7a42e5d4c418
revset-ancestorspec: call 'getset' on a 'fullreposet' Calling 'baseset(repo.changelog)' builds a list for all revisions in the repo. And we already have the lazy and efficient 'fullreposet' class for this purpose. This gives us the usual benefits of the fullreposet: revset) 100~5 before) wall 0.002712 comb 0.000000 user 0.000000 sys 0.000000 (best of 918) after) wall 0.000996 comb 0.000000 user 0.000000 sys 0.000000 (best of 2493) revset) parents(100)~5 before) wall 0.003812 comb 0.010000 user 0.010000 sys 0.000000 (best of 667) after) wall 0.001038 comb 0.000000 user 0.000000 sys 0.000000 (best of 2361) revset) (100~5)~5 before) wall 0.005614 comb 0.000000 user 0.000000 sys 0.000000 (best of 446) after) wall 0.001035 comb 0.000000 user 0.000000 sys 0.000000 (best of 2424)
mercurial/revset.py
--- a/mercurial/revset.py	Thu Oct 16 23:10:44 2014 -0700
+++ b/mercurial/revset.py	Thu Oct 16 23:11:25 2014 -0700
@@ -370,7 +370,7 @@
         raise error.ParseError(_("~ expects a number"))
     ps = set()
     cl = repo.changelog
-    for r in getset(repo, baseset(cl), x):
+    for r in getset(repo, fullreposet(repo), x):
         for i in range(n):
             r = cl.parentrevs(r)[0]
         ps.add(r)