diff mercurial/bundle2.py @ 33408:e3867c712d51

bundle2: automatically add 'targetphase' parameter in writenewbundle If we are bundling secret changeset and the bundle will contain phase, we request the changegroup to be applied as secret. It will be useful for next patch as we are now sure that secrets changesets are applied as secret and not applied as draft then forced to secret.
author Boris Feld <boris.feld@octobus.net>
date Tue, 11 Jul 2017 05:12:03 +0200
parents 39d4e5a66f5a
children 57a017f79e96
line wrap: on
line diff
--- a/mercurial/bundle2.py	Tue Jul 11 05:11:52 2017 +0200
+++ b/mercurial/bundle2.py	Tue Jul 11 05:12:03 2017 +0200
@@ -1401,6 +1401,9 @@
     if 'clcount' in cg.extras:
         part.addparam('nbchanges', str(cg.extras['clcount']),
                       mandatory=False)
+    if opts.get('phases') and repo.revs('%ln and secret()',
+                                        outgoing.missingheads):
+        part.addparam('targetphase', '%d' % phases.secret, mandatory=False)
 
     addparttagsfnodescache(repo, bundler, outgoing)