# HG changeset patch # User Gregory Szorc # Date 1534526006 0 # Node ID 484c9fe570a76ff9bbc5c0f475e9be5fe8c93a23 # Parent 860e83cd97deab88584f25cce6e1a5aa54b737e4 setdiscovery: use a revset instead of dagutil.descendantset() This is the only use of descendantset() in the repo. Strictly speaking, the revset behaves slightly differently than dagutil. The reason is that dagutil is using revlog.index for DAG traversal and this data structure isn't aware of visibility / filtering. So it can operate on revisions it shouldn't operate on. But our test coverage of this code is pretty comprehensive and this change causes no tests to fail. So I think we are good. Also, the revset parser failed to parse `%ld:: - %ld::`, hence the use of descendants(). I'm not sure if that is a feature or a bug. Differential Revision: https://phab.mercurial-scm.org/D4314 diff -r 860e83cd97de -r 484c9fe570a7 mercurial/setdiscovery.py --- a/mercurial/setdiscovery.py Thu Aug 16 20:23:10 2018 +0000 +++ b/mercurial/setdiscovery.py Fri Aug 17 17:13:26 2018 +0000 @@ -215,7 +215,12 @@ if sample: missinginsample = [n for i, n in enumerate(sample) if not yesno[i]] - missing.update(dag.descendantset(missinginsample, missing)) + + if missing: + missing.update(local.revs('descendants(%ld) - descendants(%ld)', + missinginsample, missing)) + else: + missing.update(local.revs('descendants(%ld)', missinginsample)) undecided.difference_update(missing)