##// 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 483 outdebug(self.ui, 'start of parts')
484 484 for part in self._parts:
485 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 487 yield chunk
488 488 outdebug(self.ui, 'end of bundle')
489 489 yield _pack(_fpartheadersize, 0)
@@ -726,7 +726,7 b' class bundlepart(object):'
726 726 params.append((name, value))
727 727
728 728 # methods used to generates the bundle2 stream
729 def getchunks(self):
729 def getchunks(self, ui):
730 730 if self._generated is not None:
731 731 raise RuntimeError('part can only be consumed once')
732 732 self._generated = False
@@ -735,6 +735,7 b' class bundlepart(object):'
735 735 parttype = self.type.upper()
736 736 else:
737 737 parttype = self.type.lower()
738 outdebug(ui, 'part %s: "%s"' % (self.id, parttype))
738 739 ## parttype
739 740 header = [_pack(_fparttypesize, len(parttype)),
740 741 parttype, _pack(_fpartid, self.id),
@@ -763,11 +764,13 b' class bundlepart(object):'
763 764 header.append(value)
764 765 ## finalize header
765 766 headerchunk = ''.join(header)
767 outdebug(ui, 'header chunk size: %i' % len(headerchunk))
766 768 yield _pack(_fpartheadersize, len(headerchunk))
767 769 yield headerchunk
768 770 ## payload
769 771 try:
770 772 for chunk in self._payloadchunks():
773 outdebug(ui, 'payload chunk size: %i' % len(chunk))
771 774 yield _pack(_fpayloadsize, len(chunk))
772 775 yield chunk
773 776 except BaseException, exc:
@@ -778,12 +781,14 b' class bundlepart(object):'
778 781 mandatory=False)
779 782 interpart.id = 0
780 783 yield _pack(_fpayloadsize, -1)
781 for chunk in interpart.getchunks():
784 for chunk in interpart.getchunks(ui=ui):
782 785 yield chunk
786 outdebug(ui, 'closing payload chunk')
783 787 # abort current part payload
784 788 yield _pack(_fpayloadsize, 0)
785 789 raise exc_info[0], exc_info[1], exc_info[2]
786 790 # end of payload
791 outdebug(ui, 'closing payload chunk')
787 792 yield _pack(_fpayloadsize, 0)
788 793 self._generated = True
789 794
@@ -388,12 +388,35 b' Test part'
388 388 bundle2-output: bundle parameter:
389 389 bundle2-output: start of parts
390 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 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 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 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 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 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 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 420 bundle2-output: end of bundle
398 421
399 422 $ cat ../parts.hg2
@@ -715,6 +738,8 b' Support for changegroup'
715 738 bundle2-output: bundle parameter:
716 739 bundle2-output: start of parts
717 740 bundle2-output: bundle part: "changegroup"
741 bundle2-output: part 0: "changegroup"
742 bundle2-output: header chunk size: 18
718 743 bundling: 1/4 changesets (25.00%)
719 744 bundling: 2/4 changesets (50.00%)
720 745 bundling: 3/4 changesets (75.00%)
@@ -726,6 +751,8 b' Support for changegroup'
726 751 bundling: D 1/3 files (33.33%)
727 752 bundling: E 2/3 files (66.67%)
728 753 bundling: H 3/3 files (100.00%)
754 bundle2-output: payload chunk size: 1555
755 bundle2-output: closing payload chunk
729 756 bundle2-output: end of bundle
730 757
731 758 $ cat ../rev.hg2
General Comments 0
You need to be logged in to leave comments. Login now