mercurial/bundle2.py
changeset 21597 1daad9dcdba2
parent 21186 9f3652e851f8
child 21598 1b0dbb91de5b
equal deleted inserted replaced
21596:83bbfb23cb24 21597:1daad9dcdba2
   389         self.ui = ui
   389         self.ui = ui
   390         self._params = []
   390         self._params = []
   391         self._parts = []
   391         self._parts = []
   392         self.capabilities = dict(capabilities)
   392         self.capabilities = dict(capabilities)
   393 
   393 
       
   394     # methods used to defines the bundle2 content
   394     def addparam(self, name, value=None):
   395     def addparam(self, name, value=None):
   395         """add a stream level parameter"""
   396         """add a stream level parameter"""
   396         if not name:
   397         if not name:
   397             raise ValueError('empty parameter name')
   398             raise ValueError('empty parameter name')
   398         if name[0] not in string.letters:
   399         if name[0] not in string.letters:
   405         Parts contains the actual applicative payload."""
   406         Parts contains the actual applicative payload."""
   406         assert part.id is None
   407         assert part.id is None
   407         part.id = len(self._parts) # very cheap counter
   408         part.id = len(self._parts) # very cheap counter
   408         self._parts.append(part)
   409         self._parts.append(part)
   409 
   410 
       
   411     # methods used to generate the bundle2 stream
   410     def getchunks(self):
   412     def getchunks(self):
   411         self.ui.debug('start emission of %s stream\n' % _magicstring)
   413         self.ui.debug('start emission of %s stream\n' % _magicstring)
   412         yield _magicstring
   414         yield _magicstring
   413         param = self._paramchunk()
   415         param = self._paramchunk()
   414         self.ui.debug('bundle parameter: %s\n' % param)
   416         self.ui.debug('bundle parameter: %s\n' % param)