[PATCH 1 of 5 🍦] revset-rangeset: call `getset` on a `fullreposet`

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sun Nov 2 05:46:05 CST 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1413526244 25200
#      Thu Oct 16 23:10:44 2014 -0700
# Node ID f4386029943359e65ba34c4e5d762c5452e74a57
# Parent  cc1cbb0bba8ed1d95c8f1b8e27d4d2893e0dcca7
revset-rangeset: call `getset` on a `fullreposet`

Calling `baseset(repo.changelog)` build 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 benefit ofs the fullreposet:

revset) 10:100
before) wall 0.002774 comb 0.000000 user 0.000000 sys 0.000000 (best of 797)
after)  wall 0.001977 comb 0.000000 user 0.000000 sys 0.000000 (best of 1244)

revset) parents(10):parents(100)
before) wall 0.005054 comb 0.000000 user 0.000000 sys 0.000000 (best of 481)
after)  wall 0.002060 comb 0.000000 user 0.000000 sys 0.000000 (best of 1056)

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -263,13 +263,12 @@ def symbolset(repo, subset, x):
     if x in symbols:
         raise error.ParseError(_("can't use %s here") % x)
     return stringset(repo, subset, x)
 
 def rangeset(repo, subset, x, y):
-    cl = baseset(repo.changelog)
-    m = getset(repo, cl, x)
-    n = getset(repo, cl, y)
+    m = getset(repo, fullreposet(repo), x)
+    n = getset(repo, fullreposet(repo), y)
 
     if not m or not n:
         return baseset()
     m, n = m.first(), n.last()
 


More information about the Mercurial-devel mailing list