[PATCH 2 of 2] phases: allow sharing secrets with friends (support for push)
Dov Feldstern
dovdevel at gmail.com
Sun Feb 16 19:05:01 CST 2014
# HG changeset patch
# User Dov Feldstern <dovdevel at gmail.com>
# Date 1392593749 -7200
# Mon Feb 17 01:35:49 2014 +0200
# Branch stable
# Node ID 29dc5a145d7a40c56e772fa5aee139501325bf91
# Parent 2a72585fec2c89d2f6d65c335fbc94dd3b6e3053
phases: allow sharing secrets with friends (support for push)
THIS IS NOT FOR INCLUSION AS-IS! This is just for reference along with the
discussion titled "sharing secret changesets with friends".
diff -r 2a72585fec2c -r 29dc5a145d7a mercurial/commands.py
--- a/mercurial/commands.py Mon Feb 17 00:13:33 2014 +0200
+++ b/mercurial/commands.py Mon Feb 17 01:35:49 2014 +0200
@@ -4658,6 +4658,7 @@
('b', 'branch', [],
_('a specific branch you would like to push'), _('BRANCH')),
('', 'new-branch', False, _('allow pushing a new branch')),
+ ('F', 'friend', False, _('share secret changesets with peer')),
] + remoteopts,
_('[-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]'))
def push(ui, repo, dest=None, **opts):
@@ -4727,7 +4728,7 @@
finally:
del repo._subtoppath
result = repo.push(other, opts.get('force'), revs=revs,
- newbranch=opts.get('new_branch'))
+ newbranch=opts.get('new_branch'), friend=opts.get('friend'))
result = not result
diff -r 2a72585fec2c -r 29dc5a145d7a mercurial/localrepo.py
--- a/mercurial/localrepo.py Mon Feb 17 00:13:33 2014 +0200
+++ b/mercurial/localrepo.py Mon Feb 17 01:35:49 2014 +0200
@@ -1749,7 +1749,7 @@
"""
pass
- def push(self, remote, force=False, revs=None, newbranch=False):
+ def push(self, remote, force=False, revs=None, newbranch=False, friend=False):
'''Push outgoing changesets (limited by revs) from the current
repository to remote. Return an integer:
- None means nothing to push
@@ -1815,7 +1815,7 @@
common, inc, remoteheads = commoninc
fco = discovery.findcommonoutgoing
outgoing = fco(unfi, remote, onlyheads=revs,
- commoninc=commoninc, force=force)
+ commoninc=commoninc, force=force, friend=friend)
if not outgoing.missing:
More information about the Mercurial-devel
mailing list