Mercurial > hg
comparison mercurial/bundlecaches.py @ 49326:3840d16595cf
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.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 17 May 2022 18:14:32 +0100 |
parents | bf66f7a1e3f8 |
children | 5d17dd74177d |
comparison
equal
deleted
inserted
replaced
49325:bf66f7a1e3f8 | 49326:3840d16595cf |
---|---|
42 @property | 42 @property |
43 def contentopts(self): | 43 def contentopts(self): |
44 # kept for Backward Compatibility concerns. | 44 # kept for Backward Compatibility concerns. |
45 return self.params | 45 return self.params |
46 | 46 |
47 def set_param(self, key, value): | 47 def set_param(self, key, value, overwrite=True): |
48 """overwrite a parameter value""" | 48 """Set a bundle parameter value. |
49 self._explicit_params[key] = value | 49 |
50 Will only overwrite if overwrite is true""" | |
51 if overwrite or key not in self._explicit_params: | |
52 self._explicit_params[key] = value | |
50 | 53 |
51 | 54 |
52 # Maps bundle version human names to changegroup versions. | 55 # Maps bundle version human names to changegroup versions. |
53 _bundlespeccgversions = { | 56 _bundlespeccgversions = { |
54 b'v1': b'01', | 57 b'v1': b'01', |