wireprotocol: use visibleheads as reference while unbundling (issue 3303) stable
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Thu, 26 Apr 2012 03:47:17 +0200
branchstable
changeset 16532 9eba72cdde34
parent 16531 b9f51f49bf2a
child 16533 95698ee29181
wireprotocol: use visibleheads as reference while unbundling (issue 3303) The `repo` object here is *always* local. Using `repo.heads()` ensure we will reject push if any secret changeset exists. During discovery, `visibleheads` were sent to the peer. So we can only expect it to send us `visibleheads` back. If any secret changeset exists:: visibleheads != repo.heads() This fix server side part of issue 3303 when pushing over the wire.
mercurial/wireproto.py
--- a/mercurial/wireproto.py	Wed Apr 25 17:04:18 2012 +0200
+++ b/mercurial/wireproto.py	Thu Apr 26 03:47:17 2012 +0200
@@ -555,7 +555,7 @@
     their_heads = decodelist(heads)
 
     def check_heads():
-        heads = repo.heads()
+        heads = phases.visibleheads(repo)
         heads_hash = util.sha1(''.join(sorted(heads))).digest()
         return (their_heads == ['force'] or their_heads == heads or
                 their_heads == ['hashed', heads_hash])