discovery: limit 'all local heads known remotely' to real 'all' (issue4438) stable
authorMads Kiilerich <madski@unity3d.com>
Wed, 05 Nov 2014 13:05:29 +0100
branchstable
changeset 23191 86c35b7ae300
parent 23167 a3c2d9211294
child 23192 73cfaa348650
discovery: limit 'all local heads known remotely' to real 'all' (issue4438) 3ef893520a85 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
--- a/mercurial/setdiscovery.py	Mon Nov 03 12:08:03 2014 -0500
+++ b/mercurial/setdiscovery.py	Wed Nov 05 13:05:29 2014 +0100
@@ -165,7 +165,7 @@
         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,)