Mercurial > hg
diff mercurial/discovery.py @ 16535:39d1f83eb05d stable
branchmap: server should not advertise secret changeset in branchmap (Issue3303)
Discovery now use an overlay above branchmap to prune invisible "secret"
changeset from branchmap.
To minimise impact on the code during the code freeze, this is achieve by
recomputing non-secret heads on the fly when any secret changeset exists. This
is a computation heavy approach similar to the one used for visible heads. But
few sever should contains secret changeset anyway. See comment in code for more
robust approach.
On local repo the wrapper is applied explicitly while the wire-protocol take
care of wrapping branchmap call in a transparent way. This could be unified by
the Peter Arrenbrecht and Sune Foldager proposal of a `peer` object.
An inappropriate `(+i heads)` may still appear when pushing new changes on a
repository with secret changeset. (see Issue3394 for details)
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Tue, 24 Apr 2012 16:32:44 +0200 |
parents | ba959f6e10f8 |
children | b6081c2c4647 025b3b763ba9 |
line wrap: on
line diff
--- a/mercurial/discovery.py Fri Apr 27 13:18:09 2012 -0500 +++ b/mercurial/discovery.py Tue Apr 24 16:32:44 2012 +0200 @@ -153,7 +153,10 @@ branches = set(repo[n].branch() for n in outgoing.missing) # 2. Check for new branches on the remote. - remotemap = remote.branchmap() + if remote.local(): + remotemap = phases.visiblebranchmap(remote) + else: + remotemap = remote.branchmap() newbranches = branches - set(remotemap) if newbranches and not newbranch: # new branch requires --new-branch branchnames = ', '.join(sorted(newbranches))