comparison mercurial/exchange.py @ 23975:3b7088a5c64c stable

discovery: properly exclude locally known but filtered heads The conditional was a bit too narrow and produced buggy result when a node was present in both common and heads (because it pleased the discovery) and it was locally known but filtered. This resulted in buggy getbundle request and server side crash.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 30 Jan 2015 21:11:02 +0000
parents 7817059917d0
children 13a19717ade6
comparison
equal deleted inserted replaced
23974:e484546a7c18 23975:3b7088a5c64c
944 # If a set of such "common but filtered" changeset exist on the server 944 # If a set of such "common but filtered" changeset exist on the server
945 # but are not including a remote heads, we'll not be able to detect it, 945 # but are not including a remote heads, we'll not be able to detect it,
946 scommon = set(common) 946 scommon = set(common)
947 filteredrheads = [] 947 filteredrheads = []
948 for n in rheads: 948 for n in rheads:
949 if n in nm and n not in scommon: 949 if n in nm:
950 common.append(n) 950 if n not in scommon:
951 common.append(n)
951 else: 952 else:
952 filteredrheads.append(n) 953 filteredrheads.append(n)
953 if not filteredrheads: 954 if not filteredrheads:
954 fetch = [] 955 fetch = []
955 rheads = filteredrheads 956 rheads = filteredrheads