mercurial/bundle2.py
changeset 21608 3cb96ca90c17
parent 21607 054fa5176fa7
child 21609 63cc2594ef8a
equal deleted inserted replaced
21607:054fa5176fa7 21608:3cb96ca90c17
   704 
   704 
   705         This automatically compute the size of the format to read."""
   705         This automatically compute the size of the format to read."""
   706         data = self._fromheader(struct.calcsize(format))
   706         data = self._fromheader(struct.calcsize(format))
   707         return _unpack(format, data)
   707         return _unpack(format, data)
   708 
   708 
       
   709     def _initparams(self, mandatoryparams, advisoryparams):
       
   710         """internal function to setup all logic related parameters"""
       
   711         self.mandatoryparams = mandatoryparams
       
   712         self.advisoryparams  = advisoryparams
       
   713 
   709     def _readheader(self):
   714     def _readheader(self):
   710         """read the header and setup the object"""
   715         """read the header and setup the object"""
   711         typesize = self._unpackheader(_fparttypesize)[0]
   716         typesize = self._unpackheader(_fparttypesize)[0]
   712         self.type = self._fromheader(typesize)
   717         self.type = self._fromheader(typesize)
   713         self.ui.debug('part type: "%s"\n' % self.type)
   718         self.ui.debug('part type: "%s"\n' % self.type)
   730         for key, value in mansizes:
   735         for key, value in mansizes:
   731             manparams.append((self._fromheader(key), self._fromheader(value)))
   736             manparams.append((self._fromheader(key), self._fromheader(value)))
   732         advparams = []
   737         advparams = []
   733         for key, value in advsizes:
   738         for key, value in advsizes:
   734             advparams.append((self._fromheader(key), self._fromheader(value)))
   739             advparams.append((self._fromheader(key), self._fromheader(value)))
   735         self.mandatoryparams = manparams
   740         self._initparams(manparams, advparams)
   736         self.advisoryparams  = advparams
       
   737         ## part payload
   741         ## part payload
   738         def payloadchunks():
   742         def payloadchunks():
   739             payloadsize = self._unpack(_fpayloadsize)[0]
   743             payloadsize = self._unpack(_fpayloadsize)[0]
   740             self.ui.debug('payload chunk size: %i\n' % payloadsize)
   744             self.ui.debug('payload chunk size: %i\n' % payloadsize)
   741             while payloadsize:
   745             while payloadsize: