Mercurial > hg
comparison mercurial/setdiscovery.py @ 39166:484c9fe570a7
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
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Fri, 17 Aug 2018 17:13:26 +0000 |
parents | 860e83cd97de |
children | 2d218db7389b |
comparison
equal
deleted
inserted
replaced
39165:860e83cd97de | 39166:484c9fe570a7 |
---|---|
213 progress = ui.makeprogress(_('searching'), unit=_('queries')) | 213 progress = ui.makeprogress(_('searching'), unit=_('queries')) |
214 while undecided: | 214 while undecided: |
215 | 215 |
216 if sample: | 216 if sample: |
217 missinginsample = [n for i, n in enumerate(sample) if not yesno[i]] | 217 missinginsample = [n for i, n in enumerate(sample) if not yesno[i]] |
218 missing.update(dag.descendantset(missinginsample, missing)) | 218 |
219 if missing: | |
220 missing.update(local.revs('descendants(%ld) - descendants(%ld)', | |
221 missinginsample, missing)) | |
222 else: | |
223 missing.update(local.revs('descendants(%ld)', missinginsample)) | |
219 | 224 |
220 undecided.difference_update(missing) | 225 undecided.difference_update(missing) |
221 | 226 |
222 if not undecided: | 227 if not undecided: |
223 break | 228 break |