diff 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
line wrap: on
line diff
--- a/mercurial/exchange.py	Fri Jan 30 21:40:30 2015 +0000
+++ b/mercurial/exchange.py	Fri Jan 30 21:11:02 2015 +0000
@@ -946,8 +946,9 @@
         scommon = set(common)
         filteredrheads = []
         for n in rheads:
-            if n in nm and n not in scommon:
-                common.append(n)
+            if n in nm:
+                if n not in scommon:
+                    common.append(n)
             else:
                 filteredrheads.append(n)
         if not filteredrheads: