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:
Durham Goode 2020-09-20 21:42:01 -07:00 committed by Facebook GitHub Bot
parent b78115f4e8
commit 7b4bbc2f64

View File

@ -853,9 +853,11 @@ def _children(repo, subset, parentset):
def isvisible(rev): def isvisible(rev):
return True return True
for r in subset: if minrev is not None:
if r <= minrev: for r in _makerangeset(repo, subset, minrev, smartset.maxrev, anyorder):
if r == nullrev:
continue continue
p1, p2 = pr(r) p1, p2 = pr(r)
if p1 in parentset and isvisible(r): if p1 in parentset and isvisible(r):
cs.add(r) cs.add(r)