changeset 23191:86c35b7ae300 stable

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.
author Mads Kiilerich <madski@unity3d.com>
date Wed, 05 Nov 2014 13:05:29 +0100
parents a3c2d9211294
children 73cfaa348650
files mercurial/setdiscovery.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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,)