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.
This commit is contained in:
Mads Kiilerich 2014-11-05 13:05:29 +01:00
parent 298c02c65a
commit 8079358ce3

View File

@ -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,)