@@ -4330,6 +4330,7 @@
('B', 'bookmarks', False, _('compare bookmarks')),
('b', 'branch', [], _('a specific branch you would like to push'),
_('BRANCH')),
+ ('F', 'friend', False, _('share secret changesets with peer')),
] + logopts + remoteopts + subrepoopts,
_('[-M] [-p] [-n] [-f] [-r REV]... [DEST]'))
def outgoing(ui, repo, dest=None, **opts):
@@ -88,7 +88,7 @@
return self._missing
def findcommonoutgoing(repo, other, onlyheads=None, force=False,
- commoninc=None, portable=False):
+ commoninc=None, portable=False, friend=False):
'''Return an outgoing instance to identify the nodes present in repo but
not in other.
@@ -115,8 +115,12 @@
og.missingheads = onlyheads or repo.heads()
elif onlyheads is None:
# use visible heads as it should be cached
- og.missingheads = repo.filtered("served").heads()
- og.excluded = [ctx.node() for ctx in repo.set('secret() or extinct()')]
+ if friend:
+ og.missingheads = repo.filtered("visible").heads()
+ og.excluded = [ctx.node() for ctx in repo.set('extinct()')]
+ else:
+ og.missingheads = repo.filtered("served").heads()
+ og.excluded = [ctx.node() for ctx in repo.set('secret() or extinct()')]
else:
# compute common, missing and exclude secret stuff
sets = repo.changelog.findcommonmissing(og.commonheads, onlyheads)
@@ -125,7 +129,7 @@
og.excluded = excluded = []
for node in allmissing:
ctx = repo[node]
- if ctx.phase() >= phases.secret or ctx.extinct():
+ if (ctx.phase() >= phases.secret and not friend) or ctx.extinct():
excluded.append(node)
else:
missing.append(node)
@@ -555,7 +555,7 @@
other = peer(repo, opts, dest)
outgoing = discovery.findcommonoutgoing(repo.unfiltered(), other, revs,
- force=opts.get('force'))
+ force=opts.get('force'), friend=opts.get('friend'))
o = outgoing.missing
if not o:
scmutil.nochangesfound(repo.ui, repo, outgoing.excluded)