comparison mercurial/setdiscovery.py @ 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 ced632394371
children 73cfaa348650
comparison
equal deleted inserted replaced
23167:a3c2d9211294 23191:86c35b7ae300
163 srvheads = dag.internalizeall(srvheadhashes, filterunknown=True) 163 srvheads = dag.internalizeall(srvheadhashes, filterunknown=True)
164 if len(srvheads) == len(srvheadhashes): 164 if len(srvheads) == len(srvheadhashes):
165 ui.debug("all remote heads known locally\n") 165 ui.debug("all remote heads known locally\n")
166 return (srvheadhashes, False, srvheadhashes,) 166 return (srvheadhashes, False, srvheadhashes,)
167 167
168 if sample and util.all(yesno): 168 if sample and len(ownheads) <= initialsamplesize and util.all(yesno):
169 ui.note(_("all local heads known remotely\n")) 169 ui.note(_("all local heads known remotely\n"))
170 ownheadhashes = dag.externalizeall(ownheads) 170 ownheadhashes = dag.externalizeall(ownheads)
171 return (ownheadhashes, True, srvheadhashes,) 171 return (ownheadhashes, True, srvheadhashes,)
172 172
173 # full blown discovery 173 # full blown discovery