Mercurial > hg
changeset 16532:9eba72cdde34 stable
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.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Thu, 26 Apr 2012 03:47:17 +0200 |
parents | b9f51f49bf2a |
children | 95698ee29181 |
files | mercurial/wireproto.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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])