# HG changeset patch # User Mads Kiilerich # Date 1415189129 -3600 # Node ID 86c35b7ae300358c2a6fb18580970ae55f075ed7 # Parent a3c2d92112948b2fa1ac3881920ac4d932cda6c8 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. diff -r a3c2d9211294 -r 86c35b7ae300 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,)