changeset 41887:c98420914c10

discovery: simply walk the undecided revs when building the children mapping The sampling only care about revisions in the undecided set, so building children relationship within this set is sufficient. The set of undecided changesets can be much smaller than the full span from its smallest item to the tip of the repository. This restriction can significantly speed up operations in some cases. For example, on our private pathological case, this speeds things up from about 53 seconds to about 7.5 seconds.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 05 Mar 2019 15:52:14 +0100
parents e514799e4e07
children 1f069f37e601
files mercurial/setdiscovery.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/setdiscovery.py	Thu Feb 28 00:56:27 2019 +0100
+++ b/mercurial/setdiscovery.py	Tue Mar 05 15:52:14 2019 +0100
@@ -216,7 +216,7 @@
         # this by keeping a persistent cache of children across invocations.
         children = {}
 
-        for rev in repo.changelog.revs(start=min(revsroots)):
+        for rev in sorted(revs):
             # Always ensure revision has an entry so we don't need to worry
             # about missing keys.
             children.setdefault(rev, [])