From 8079358ce36193b0f92a08c0df8f57edf91c867e Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Wed, 5 Nov 2014 13:05:29 +0100 Subject: [PATCH] discovery: limit 'all local heads known remotely' to real 'all' (issue4438) 2ec3e28dea6b made it possible that the initial head check didn't include all heads. If that is the case, don't use the early exit just because this random sample happened to be 'all known'. Note: the randomness in the discovery protocol can make this problem hard to reproduce. --- mercurial/setdiscovery.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py index e1e567d351..6dda173d49 100644 --- a/mercurial/setdiscovery.py +++ b/mercurial/setdiscovery.py @@ -165,7 +165,7 @@ def findcommonheads(ui, local, remote, ui.debug("all remote heads known locally\n") return (srvheadhashes, False, srvheadhashes,) - if sample and util.all(yesno): + if sample and len(ownheads) <= initialsamplesize and util.all(yesno): ui.note(_("all local heads known remotely\n")) ownheadhashes = dag.externalizeall(ownheads) return (ownheadhashes, True, srvheadhashes,)