##// END OF EJS Templates
bundle2: introduce a specific function for bundling debug message...
Pierre-Yves David -
r25313:8f2c362b default
parent child Browse files
Show More
@@ -173,6 +173,10 b' preferedchunksize = 4096'
173
173
174 _parttypeforbidden = re.compile('[^a-zA-Z0-9_:-]')
174 _parttypeforbidden = re.compile('[^a-zA-Z0-9_:-]')
175
175
176 def outdebug(ui, message):
177 """debug regarding output stream (bundling)"""
178 ui.debug(message)
179
176 def validateparttype(parttype):
180 def validateparttype(parttype):
177 """raise ValueError if a parttype contains invalid character"""
181 """raise ValueError if a parttype contains invalid character"""
178 if _parttypeforbidden.search(parttype):
182 if _parttypeforbidden.search(parttype):
@@ -464,20 +468,20 b' class bundle20(object):'
464
468
465 # methods used to generate the bundle2 stream
469 # methods used to generate the bundle2 stream
466 def getchunks(self):
470 def getchunks(self):
467 self.ui.debug('start emission of %s stream\n' % self._magicstring)
471 outdebug(self.ui, 'start emission of %s stream\n' % self._magicstring)
468 yield self._magicstring
472 yield self._magicstring
469 param = self._paramchunk()
473 param = self._paramchunk()
470 self.ui.debug('bundle parameter: %s\n' % param)
474 outdebug(self.ui, 'bundle parameter: %s\n' % param)
471 yield _pack(_fstreamparamsize, len(param))
475 yield _pack(_fstreamparamsize, len(param))
472 if param:
476 if param:
473 yield param
477 yield param
474
478
475 self.ui.debug('start of parts\n')
479 outdebug(self.ui, 'start of parts\n')
476 for part in self._parts:
480 for part in self._parts:
477 self.ui.debug('bundle part: "%s"\n' % part.type)
481 outdebug(self.ui, 'bundle part: "%s"\n' % part.type)
478 for chunk in part.getchunks():
482 for chunk in part.getchunks():
479 yield chunk
483 yield chunk
480 self.ui.debug('end of bundle\n')
484 outdebug(self.ui, 'end of bundle\n')
481 yield _pack(_fpartheadersize, 0)
485 yield _pack(_fpartheadersize, 0)
482
486
483 def _paramchunk(self):
487 def _paramchunk(self):
General Comments 0
You need to be logged in to leave comments. Login now