Patchwork [2,of,2] phases: allow sharing secrets with friends (support for push)

login
register
mail settings
Submitter Dov Feldstern
Date Feb. 17, 2014, 1:05 a.m.
Message ID <29dc5a145d7a40c56e77.1392599101@pollen.home>
Download mbox | patch
Permalink /patch/3680/
State Rejected
Headers show

Comments

Dov Feldstern - Feb. 17, 2014, 1:05 a.m.
# HG changeset patch
# User Dov Feldstern <dovdevel@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".
Pierre-Yves David - Dec. 22, 2014, 11:10 p.m.
On 02/16/2014 05:05 PM, Dov Feldstern wrote:
> # HG changeset patch
> # User Dov Feldstern <dovdevel@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)

Last time such idea was discussed we came with a proposal to add 
"metadata" to path, one of them being about including secret changeset 
during the push and pull. This would be a good start.

(sorry for the delay totally overlooked your original email)

Patch

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: