changeset 21612:f221eb0531d9

bundle2: expose mandatory params in a mandatorykeys attribute We expose all keys that MUST be processed in ``part.mandatorykeys``. This makes it much easier to access the information. Enforcement of the mandatory parameters is coming in later changesets.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 23 May 2014 20:23:54 -0700
parents 71b7b3f79a3c
children b3213b9fafed
files mercurial/bundle2.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundle2.py	Mon May 26 18:45:43 2014 -0700
+++ b/mercurial/bundle2.py	Fri May 23 20:23:54 2014 -0700
@@ -690,6 +690,7 @@
         self.mandatoryparams = None
         self.advisoryparams = None
         self.params = None
+        self.mandatorykeys = ()
         self._payloadstream = None
         self._readheader()
 
@@ -715,6 +716,7 @@
         # user friendly UI
         self.params = dict(self.mandatoryparams)
         self.params.update(dict(self.advisoryparams))
+        self.mandatorykeys = frozenset(p[0] for p in mandatoryparams)
 
     def _readheader(self):
         """read the header and setup the object"""