# HG changeset patch # User Pierre-Yves David # Date 2012-04-26 01:47:17 # Node ID 9eba72cdde3464784bcdfff30aebc7902553347c # Parent b9f51f49bf2a296ab857aff0b2bc39005027979b 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. diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -555,7 +555,7 @@ def unbundle(repo, proto, heads): 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])