changeset 49327:5bc3e76f919d

bundlespec: do not overwrite bundlespec value with the config one This is finally making the `obsolete` bundlespec paramater work.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 24 May 2022 18:43:24 +0200
parents 3840d16595cf
children aaa7df6992ea
files mercurial/commands.py tests/test-obsolete-bundle-strip.t
diffstat 2 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Tue May 17 18:14:32 2022 +0100
+++ b/mercurial/commands.py	Tue May 24 18:43:24 2022 +0200
@@ -1681,11 +1681,13 @@
     # support the necessary features.
     cfg = ui.configbool
     obsolescence_cfg = cfg(b'experimental', b'evolution.bundle-obsmarker')
-    bundlespec.set_param(b'obsolescence', obsolescence_cfg)
+    bundlespec.set_param(b'obsolescence', obsolescence_cfg, overwrite=False)
     obs_mand_cfg = cfg(b'experimental', b'evolution.bundle-obsmarker:mandatory')
-    bundlespec.set_param(b'obsolescence-mandatory', obs_mand_cfg)
+    bundlespec.set_param(
+        b'obsolescence-mandatory', obs_mand_cfg, overwrite=False
+    )
     phases_cfg = cfg(b'experimental', b'bundle-phases')
-    bundlespec.set_param(b'phases', phases_cfg)
+    bundlespec.set_param(b'phases', phases_cfg, overwrite=False)
 
     bundle2.writenewbundle(
         ui,
--- a/tests/test-obsolete-bundle-strip.t	Tue May 17 18:14:32 2022 +0100
+++ b/tests/test-obsolete-bundle-strip.t	Tue May 24 18:43:24 2022 +0200
@@ -1491,6 +1491,6 @@
   1 changesets found
   $ hg debugbundle bundle-type-with-obs --part-type obsmarkers
   Stream params: {Compression: BZ}
-  obsmarkers -- {} (mandatory: True) (missing-correct-output !)
-      version: 1 (50 bytes) (missing-correct-output !)
-      1ea73414a91b0920940797d8fc6a11e447f8ea1e 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} (missing-correct-output !)
+  obsmarkers -- {} (mandatory: True)
+      version: 1 (50 bytes)
+      1ea73414a91b0920940797d8fc6a11e447f8ea1e 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}