Mercurial > hg
comparison mercurial/discovery.py @ 15713:cff25e4b37d2
phases: do not exchange secret changesets
Any secret changesets will be excluded from pull and push. Phase data are
properly synchronized on pull and push if a changeset is seen as secret locally
but is non-secret remote side.
This patch does not handle the case of a changeset secret on remote but known
locally.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Thu, 22 Dec 2011 00:42:25 +0100 |
parents | 646759147717 |
children | cd956049fc14 |
comparison
equal
deleted
inserted
replaced
15712:06b8b74720d6 | 15713:cff25e4b37d2 |
---|---|
83 common, revs = findcommonoutgoing(repo, remote, onlyheads=revs, | 83 common, revs = findcommonoutgoing(repo, remote, onlyheads=revs, |
84 commoninc=commoninc, force=force) | 84 commoninc=commoninc, force=force) |
85 _common, inc, remoteheads = commoninc | 85 _common, inc, remoteheads = commoninc |
86 | 86 |
87 cl = repo.changelog | 87 cl = repo.changelog |
88 outg = cl.findmissing(common, revs) | 88 alloutg = cl.findmissing(common, revs) |
89 outg = [] | |
90 secret = [] | |
91 for o in alloutg: | |
92 if repo[o].phase() >= 2: | |
93 secret.append(o) | |
94 else: | |
95 outg.append(o) | |
89 | 96 |
90 if not outg: | 97 if not outg: |
91 repo.ui.status(_("no changes found\n")) | 98 if secret: |
99 repo.ui.status(_("no changes to push but %i secret changesets\n") | |
100 % len(secret)) | |
101 else: | |
102 repo.ui.status(_("no changes found\n")) | |
92 return None, 1, common | 103 return None, 1, common |
104 | |
105 if secret: | |
106 # recompute target revs | |
107 revs = [ctx.node() for ctx in repo.set('heads(::(%ld))', | |
108 map(repo.changelog.rev, outg))] | |
93 | 109 |
94 if not force and remoteheads != [nullid]: | 110 if not force and remoteheads != [nullid]: |
95 if remote.capable('branchmap'): | 111 if remote.capable('branchmap'): |
96 # Check for each named branch if we're creating new remote heads. | 112 # Check for each named branch if we're creating new remote heads. |
97 # To be a remote head after push, node must be either: | 113 # To be a remote head after push, node must be either: |