##// END OF EJS Templates
bundle2: add debug output for part generation...
Pierre-Yves David -
r25321:b44ee346 default
parent child Browse files
Show More
@@ -483,7 +483,7 b' class bundle20(object):'
483 outdebug(self.ui, 'start of parts')
483 outdebug(self.ui, 'start of parts')
484 for part in self._parts:
484 for part in self._parts:
485 outdebug(self.ui, 'bundle part: "%s"' % part.type)
485 outdebug(self.ui, 'bundle part: "%s"' % part.type)
486 for chunk in part.getchunks():
486 for chunk in part.getchunks(ui=self.ui):
487 yield chunk
487 yield chunk
488 outdebug(self.ui, 'end of bundle')
488 outdebug(self.ui, 'end of bundle')
489 yield _pack(_fpartheadersize, 0)
489 yield _pack(_fpartheadersize, 0)
@@ -726,7 +726,7 b' class bundlepart(object):'
726 params.append((name, value))
726 params.append((name, value))
727
727
728 # methods used to generates the bundle2 stream
728 # methods used to generates the bundle2 stream
729 def getchunks(self):
729 def getchunks(self, ui):
730 if self._generated is not None:
730 if self._generated is not None:
731 raise RuntimeError('part can only be consumed once')
731 raise RuntimeError('part can only be consumed once')
732 self._generated = False
732 self._generated = False
@@ -735,6 +735,7 b' class bundlepart(object):'
735 parttype = self.type.upper()
735 parttype = self.type.upper()
736 else:
736 else:
737 parttype = self.type.lower()
737 parttype = self.type.lower()
738 outdebug(ui, 'part %s: "%s"' % (self.id, parttype))
738 ## parttype
739 ## parttype
739 header = [_pack(_fparttypesize, len(parttype)),
740 header = [_pack(_fparttypesize, len(parttype)),
740 parttype, _pack(_fpartid, self.id),
741 parttype, _pack(_fpartid, self.id),
@@ -763,11 +764,13 b' class bundlepart(object):'
763 header.append(value)
764 header.append(value)
764 ## finalize header
765 ## finalize header
765 headerchunk = ''.join(header)
766 headerchunk = ''.join(header)
767 outdebug(ui, 'header chunk size: %i' % len(headerchunk))
766 yield _pack(_fpartheadersize, len(headerchunk))
768 yield _pack(_fpartheadersize, len(headerchunk))
767 yield headerchunk
769 yield headerchunk
768 ## payload
770 ## payload
769 try:
771 try:
770 for chunk in self._payloadchunks():
772 for chunk in self._payloadchunks():
773 outdebug(ui, 'payload chunk size: %i' % len(chunk))
771 yield _pack(_fpayloadsize, len(chunk))
774 yield _pack(_fpayloadsize, len(chunk))
772 yield chunk
775 yield chunk
773 except BaseException, exc:
776 except BaseException, exc:
@@ -778,12 +781,14 b' class bundlepart(object):'
778 mandatory=False)
781 mandatory=False)
779 interpart.id = 0
782 interpart.id = 0
780 yield _pack(_fpayloadsize, -1)
783 yield _pack(_fpayloadsize, -1)
781 for chunk in interpart.getchunks():
784 for chunk in interpart.getchunks(ui=ui):
782 yield chunk
785 yield chunk
786 outdebug(ui, 'closing payload chunk')
783 # abort current part payload
787 # abort current part payload
784 yield _pack(_fpayloadsize, 0)
788 yield _pack(_fpayloadsize, 0)
785 raise exc_info[0], exc_info[1], exc_info[2]
789 raise exc_info[0], exc_info[1], exc_info[2]
786 # end of payload
790 # end of payload
791 outdebug(ui, 'closing payload chunk')
787 yield _pack(_fpayloadsize, 0)
792 yield _pack(_fpayloadsize, 0)
788 self._generated = True
793 self._generated = True
789
794
@@ -388,12 +388,35 b' Test part'
388 bundle2-output: bundle parameter:
388 bundle2-output: bundle parameter:
389 bundle2-output: start of parts
389 bundle2-output: start of parts
390 bundle2-output: bundle part: "test:empty"
390 bundle2-output: bundle part: "test:empty"
391 bundle2-output: part 0: "test:empty"
392 bundle2-output: header chunk size: 17
393 bundle2-output: closing payload chunk
391 bundle2-output: bundle part: "test:empty"
394 bundle2-output: bundle part: "test:empty"
395 bundle2-output: part 1: "test:empty"
396 bundle2-output: header chunk size: 17
397 bundle2-output: closing payload chunk
392 bundle2-output: bundle part: "test:song"
398 bundle2-output: bundle part: "test:song"
399 bundle2-output: part 2: "test:song"
400 bundle2-output: header chunk size: 16
401 bundle2-output: payload chunk size: 178
402 bundle2-output: closing payload chunk
393 bundle2-output: bundle part: "test:debugreply"
403 bundle2-output: bundle part: "test:debugreply"
404 bundle2-output: part 3: "test:debugreply"
405 bundle2-output: header chunk size: 22
406 bundle2-output: closing payload chunk
394 bundle2-output: bundle part: "test:math"
407 bundle2-output: bundle part: "test:math"
408 bundle2-output: part 4: "test:math"
409 bundle2-output: header chunk size: 43
410 bundle2-output: payload chunk size: 2
411 bundle2-output: closing payload chunk
395 bundle2-output: bundle part: "test:song"
412 bundle2-output: bundle part: "test:song"
413 bundle2-output: part 5: "test:song"
414 bundle2-output: header chunk size: 29
415 bundle2-output: closing payload chunk
396 bundle2-output: bundle part: "test:ping"
416 bundle2-output: bundle part: "test:ping"
417 bundle2-output: part 6: "test:ping"
418 bundle2-output: header chunk size: 16
419 bundle2-output: closing payload chunk
397 bundle2-output: end of bundle
420 bundle2-output: end of bundle
398
421
399 $ cat ../parts.hg2
422 $ cat ../parts.hg2
@@ -715,6 +738,8 b' Support for changegroup'
715 bundle2-output: bundle parameter:
738 bundle2-output: bundle parameter:
716 bundle2-output: start of parts
739 bundle2-output: start of parts
717 bundle2-output: bundle part: "changegroup"
740 bundle2-output: bundle part: "changegroup"
741 bundle2-output: part 0: "changegroup"
742 bundle2-output: header chunk size: 18
718 bundling: 1/4 changesets (25.00%)
743 bundling: 1/4 changesets (25.00%)
719 bundling: 2/4 changesets (50.00%)
744 bundling: 2/4 changesets (50.00%)
720 bundling: 3/4 changesets (75.00%)
745 bundling: 3/4 changesets (75.00%)
@@ -726,6 +751,8 b' Support for changegroup'
726 bundling: D 1/3 files (33.33%)
751 bundling: D 1/3 files (33.33%)
727 bundling: E 2/3 files (66.67%)
752 bundling: E 2/3 files (66.67%)
728 bundling: H 3/3 files (100.00%)
753 bundling: H 3/3 files (100.00%)
754 bundle2-output: payload chunk size: 1555
755 bundle2-output: closing payload chunk
729 bundle2-output: end of bundle
756 bundle2-output: end of bundle
730
757
731 $ cat ../rev.hg2
758 $ cat ../rev.hg2
General Comments 0
You need to be logged in to leave comments. Login now