mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 07:49:11 +03:00
bundle2: introduce a `params
` dictionary on unbundled parts
This exposes all parameters the part received into a ``part.params`` dictionary. This should be much easier to use. This dictionary itself does not expose the mandatory or advisory aspect of parameters, but no current users of bundle2 actually enforce any of this logic. Coming changesets will improve this aspect.
This commit is contained in:
parent
ecdd6aaf9e
commit
75a728d5f5
@ -689,6 +689,7 @@ class unbundlepart(unpackermixin):
|
||||
self.type = None
|
||||
self.mandatoryparams = None
|
||||
self.advisoryparams = None
|
||||
self.params = None
|
||||
self._payloadstream = None
|
||||
self._readheader()
|
||||
|
||||
@ -711,6 +712,9 @@ class unbundlepart(unpackermixin):
|
||||
# make it read only to prevent people touching it by mistake.
|
||||
self.mandatoryparams = tuple(mandatoryparams)
|
||||
self.advisoryparams = tuple(advisoryparams)
|
||||
# user friendly UI
|
||||
self.params = dict(self.mandatoryparams)
|
||||
self.params.update(dict(self.advisoryparams))
|
||||
|
||||
def _readheader(self):
|
||||
"""read the header and setup the object"""
|
||||
|
Loading…
Reference in New Issue
Block a user