mirror of
https://github.com/facebook/sapling.git
synced 2024-12-26 06:21:48 +03:00
revset: avoid full repo scan in children revset
Summary: The children revset iterated over everything in the subset, which in many cases was the entire repo. This can take hundreds of milliseconds. Let's use the new _makerangeset to only iterate over descendants of the parentset. Reviewed By: quark-zju Differential Revision: D23794344 fbshipit-source-id: 9ac9bc014d56a95b5ac65534769389167b0f4508
This commit is contained in:
parent
b78115f4e8
commit
7b4bbc2f64
@ -853,14 +853,16 @@ def _children(repo, subset, parentset):
|
||||
def isvisible(rev):
|
||||
return True
|
||||
|
||||
for r in subset:
|
||||
if r <= minrev:
|
||||
continue
|
||||
p1, p2 = pr(r)
|
||||
if p1 in parentset and isvisible(r):
|
||||
cs.add(r)
|
||||
if p2 != nullrev and p2 in parentset and isvisible(r):
|
||||
cs.add(r)
|
||||
if minrev is not None:
|
||||
for r in _makerangeset(repo, subset, minrev, smartset.maxrev, anyorder):
|
||||
if r == nullrev:
|
||||
continue
|
||||
|
||||
p1, p2 = pr(r)
|
||||
if p1 in parentset and isvisible(r):
|
||||
cs.add(r)
|
||||
if p2 != nullrev and p2 in parentset and isvisible(r):
|
||||
cs.add(r)
|
||||
return baseset(cs)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user