discovery: explicitly use `undecided` for the children mapping
Recent performance achievements makes the assumption that the `undecided` set
is used for sampling. That assumption is always true in practice. We stop
pretending that taking anything else would make sense and we directly use the
`undecided` set from the object. This provides a more honest API.
--- a/mercurial/setdiscovery.py Thu Feb 28 01:48:20 2019 +0100
+++ b/mercurial/setdiscovery.py Thu Feb 28 01:49:10 2019 +0100
@@ -172,7 +172,7 @@
return getrev(r)[5:6]
return getparents
- def _childrengetter(self, revs):
+ def _childrengetter(self):
if self._childrenmap is not None:
return self._childrenmap.__getitem__
@@ -184,6 +184,7 @@
self._childrenmap = children = {}
parentrevs = self._parentsgetter()
+ revs = self.undecided
for rev in sorted(revs):
# Always ensure revision has an entry so we don't need to worry
@@ -232,7 +233,7 @@
# update from roots
revsroots = set(repo.revs('roots(%ld)', revs))
- childrenrevs = self._childrengetter(revs)
+ childrenrevs = self._childrengetter()
_updatesample(revs, revsroots, sample, childrenrevs)
assert sample