mercurial/commands.py
changeset 37167 6c7a6b04b274
parent 37166 b229fd9adeae
child 37253 7c0f40f4f7bf
--- a/mercurial/commands.py	Fri Mar 30 12:43:08 2018 +0200
+++ b/mercurial/commands.py	Fri Mar 30 12:43:57 2018 +0200
@@ -1204,7 +1204,7 @@
         raise error.Abort(pycompat.bytestr(e),
                           hint=_("see 'hg help bundlespec' for supported "
                                  "values for --type"))
-    cgversion = bundlespec.version
+    cgversion = bundlespec.contentopts["cg.version"]
 
     # Packed bundles are a pseudo bundle format for now.
     if cgversion == 's1':
@@ -1267,14 +1267,15 @@
     if complevel is not None:
         compopts['level'] = complevel
 
-
-    contentopts = {'cg.version': cgversion, 'changegroup': True}
+    # Allow overriding the bundling of obsmarker in phases through
+    # configuration while we don't have a bundle version that include them
     if repo.ui.configbool('experimental', 'evolution.bundle-obsmarker'):
-        contentopts['obsolescence'] = True
+        bundlespec.contentopts['obsolescence'] = True
     if repo.ui.configbool('experimental', 'bundle-phases'):
-        contentopts['phases'] = True
+        bundlespec.contentopts['phases'] = True
+
     bundle2.writenewbundle(ui, repo, 'bundle', fname, bversion, outgoing,
-                           contentopts, compression=bcompression,
+                           bundlespec.contentopts, compression=bcompression,
                            compopts=compopts)
 
 @command('cat',