Patchwork [3,of,5] revset-children: call `getset` on a `fullreposet`

login
register
mail settings
Submitter Pierre-Yves David
Date Oct. 17, 2014, 5:49 p.m.
Message ID <bdcaab9d99c21ac79343.1413568169@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/6374/
State Deferred
Headers show

Comments

Pierre-Yves David - Oct. 17, 2014, 5:49 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1413526457 25200
#      Thu Oct 16 23:14:17 2014 -0700
# Node ID bdcaab9d99c21ac793437f1ad90cb1a9cb8033e7
# Parent  088da6eacbda46121b3dc3dae6c5509dfd9ea474
revset-children: call `getset` on a `fullreposet`

Calling `baseset(repo.changelog)` build a list for all revision 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) children(tip~100)
before) wall 0.007469 comb 0.010000 user 0.010000 sys 0.000000 (best of 338)
after)  wall 0.003356 comb 0.000000 user 0.000000 sys 0.000000 (best of 755)

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -569,11 +569,11 @@  def _children(repo, narrow, parentset):
 
 def children(repo, subset, x):
     """``children(set)``
     Child changesets of changesets in set.
     """
-    s = getset(repo, baseset(repo), x)
+    s = getset(repo, fullreposet(repo), x)
     cs = _children(repo, subset, s)
     return subset & cs
 
 def closed(repo, subset, x):
     """``closed()``