bundlespec: add a `overwrite` parameter to set_param
This will open the way for the configuration value to yield in front of the
explicit bundle type.
--- a/mercurial/bundlecaches.py Tue May 17 16:36:32 2022 +0100
+++ b/mercurial/bundlecaches.py Tue May 17 18:14:32 2022 +0100
@@ -44,9 +44,12 @@
# kept for Backward Compatibility concerns.
return self.params
- def set_param(self, key, value):
- """overwrite a parameter value"""
- self._explicit_params[key] = value
+ def set_param(self, key, value, overwrite=True):
+ """Set a bundle parameter value.
+
+ Will only overwrite if overwrite is true"""
+ if overwrite or key not in self._explicit_params:
+ self._explicit_params[key] = value
# Maps bundle version human names to changegroup versions.