##// END OF EJS Templates
bundle20: move magic string into the class...
Pierre-Yves David -
r24640:685639f9 default
parent child Browse files
Show More
@@ -162,8 +162,6 b' from i18n import _'
162 _pack = struct.pack
162 _pack = struct.pack
163 _unpack = struct.unpack
163 _unpack = struct.unpack
164
164
165 _magicstring = 'HG2Y'
166
167 _fstreamparamsize = '>i'
165 _fstreamparamsize = '>i'
168 _fpartheadersize = '>i'
166 _fpartheadersize = '>i'
169 _fparttypesize = '>B'
167 _fparttypesize = '>B'
@@ -410,6 +408,8 b' class bundle20(object):'
410 populate it. Then call `getchunks` to retrieve all the binary chunks of
408 populate it. Then call `getchunks` to retrieve all the binary chunks of
411 data that compose the bundle2 container."""
409 data that compose the bundle2 container."""
412
410
411 _magicstring = 'HG2Y'
412
413 def __init__(self, ui, capabilities=()):
413 def __init__(self, ui, capabilities=()):
414 self.ui = ui
414 self.ui = ui
415 self._params = []
415 self._params = []
@@ -453,8 +453,8 b' class bundle20(object):'
453
453
454 # methods used to generate the bundle2 stream
454 # methods used to generate the bundle2 stream
455 def getchunks(self):
455 def getchunks(self):
456 self.ui.debug('start emission of %s stream\n' % _magicstring)
456 self.ui.debug('start emission of %s stream\n' % self._magicstring)
457 yield _magicstring
457 yield self._magicstring
458 param = self._paramchunk()
458 param = self._paramchunk()
459 self.ui.debug('bundle parameter: %s\n' % param)
459 self.ui.debug('bundle parameter: %s\n' % param)
460 yield _pack(_fstreamparamsize, len(param))
460 yield _pack(_fstreamparamsize, len(param))
General Comments 0
You need to be logged in to leave comments. Login now