Mercurial > hg
comparison mercurial/setdiscovery.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 | 9bea3aed6ee1 |
children | 525fdb738975 |
comparison
equal
deleted
inserted
replaced
15712:06b8b74720d6 | 15713:cff25e4b37d2 |
---|---|
7 # GNU General Public License version 2 or any later version. | 7 # GNU General Public License version 2 or any later version. |
8 | 8 |
9 from node import nullid | 9 from node import nullid |
10 from i18n import _ | 10 from i18n import _ |
11 import random, collections, util, dagutil | 11 import random, collections, util, dagutil |
12 import phases | |
12 | 13 |
13 def _updatesample(dag, nodes, sample, always, quicksamplesize=0): | 14 def _updatesample(dag, nodes, sample, always, quicksamplesize=0): |
14 # if nodes is empty we scan the entire graph | 15 # if nodes is empty we scan the entire graph |
15 if nodes: | 16 if nodes: |
16 heads = dag.headsetofconnecteds(nodes) | 17 heads = dag.headsetofconnecteds(nodes) |
97 roundtrips += 1 | 98 roundtrips += 1 |
98 ownheads = dag.heads() | 99 ownheads = dag.heads() |
99 sample = ownheads | 100 sample = ownheads |
100 if remote.local(): | 101 if remote.local(): |
101 # stopgap until we have a proper localpeer that supports batch() | 102 # stopgap until we have a proper localpeer that supports batch() |
102 srvheadhashes = remote.heads() | 103 srvheadhashes = phases.visibleheads(remote) |
103 yesno = remote.known(dag.externalizeall(sample)) | 104 yesno = remote.known(dag.externalizeall(sample)) |
104 elif remote.capable('batch'): | 105 elif remote.capable('batch'): |
105 batch = remote.batch() | 106 batch = remote.batch() |
106 srvheadhashesref = batch.heads() | 107 srvheadhashesref = batch.heads() |
107 yesnoref = batch.known(dag.externalizeall(sample)) | 108 yesnoref = batch.known(dag.externalizeall(sample)) |