changeset 21609:63cc2594ef8a

bundle2: make sure unbundled part param are read-only My old uncle Robert once trusted an API user. We never saw him again.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 23 May 2014 17:17:39 -0700
parents 3cb96ca90c17
children d6056805f8f4
files mercurial/bundle2.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundle2.py	Wed May 28 10:04:02 2014 -0700
+++ b/mercurial/bundle2.py	Fri May 23 17:17:39 2014 -0700
@@ -708,8 +708,9 @@
 
     def _initparams(self, mandatoryparams, advisoryparams):
         """internal function to setup all logic related parameters"""
-        self.mandatoryparams = mandatoryparams
-        self.advisoryparams  = advisoryparams
+        # make it read only to prevent people touching it by mistake.
+        self.mandatoryparams = tuple(mandatoryparams)
+        self.advisoryparams  = tuple(advisoryparams)
 
     def _readheader(self):
         """read the header and setup the object"""