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.
--- 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])