# HG changeset patch # User Mads Kiilerich # Date 2014-11-05 12:05:32 # Node ID 73cfaa34865061744250a63ed01e970ad7a4bf3d # Parent 86c35b7ae300358c2a6fb18580970ae55f075ed7 discovery: indices between sample and yesno must match (issue4438) 3ef893520a85 changed 'sample' from a list to a set. The iteration order is thus undefined and the yesno indices are not stable. To solve this, repeat the listification and comment from elsewhere in the code. Note: the randomness in the discovery protocol can make this problem hard to reproduce. diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py --- a/mercurial/setdiscovery.py +++ b/mercurial/setdiscovery.py @@ -134,6 +134,8 @@ def findcommonheads(ui, local, remote, roundtrips += 1 ownheads = dag.heads() sample = _limitsample(ownheads, initialsamplesize) + # indices between sample and externalized version must match + sample = list(sample) if remote.local(): # stopgap until we have a proper localpeer that supports batch() srvheadhashes = remote.heads()