changeset 21610:d6056805f8f4

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.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 23 May 2014 17:26:57 -0700
parents 63cc2594ef8a
children 71b7b3f79a3c
files mercurial/bundle2.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundle2.py	Fri May 23 17:17:39 2014 -0700
+++ b/mercurial/bundle2.py	Fri May 23 17:26:57 2014 -0700
@@ -689,6 +689,7 @@
         self.type = None
         self.mandatoryparams = None
         self.advisoryparams = None
+        self.params = None
         self._payloadstream = None
         self._readheader()
 
@@ -711,6 +712,9 @@
         # 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"""