bundle2: add generic debug output regarding generated parts

If we are about to hide the detailed debug output, we need some generic debug
message to replace it in a concise way.
This commit is contained in:
Pierre-Yves David 2015-05-27 00:19:16 -07:00
parent 2aa990e3f6
commit aca59375f8
2 changed files with 31 additions and 0 deletions

View File

@ -736,6 +736,29 @@ class bundlepart(object):
if self._generated is not None:
raise RuntimeError('part can only be consumed once')
self._generated = False
if ui.debugflag:
msg = ['bundle2-output-part: "%s"' % self.type]
if not self.mandatory:
msg.append(' (advisory)')
nbmp = len(self.mandatoryparams)
nbap = len(self.advisoryparams)
if nbmp or nbap:
msg.append(' (params:')
if nbmp:
msg.append(' %i mandatory' % nbmp)
if nbap:
msg.append(' %i advisory' % nbmp)
msg.append(')')
if not self.data:
msg.append(' empty payload')
elif util.safehasattr(self.data, 'next'):
msg.append(' streamed payload')
else:
msg.append(' %i bytes payload' % len(self.data))
msg.append('\n')
ui.debug(''.join(msg))
#### header
if self.mandatory:
parttype = self.type.upper()

View File

@ -390,32 +390,39 @@ Test part
bundle2-output: bundle parameter:
bundle2-output: start of parts
bundle2-output: bundle part: "test:empty"
bundle2-output-part: "test:empty" (advisory) empty payload
bundle2-output: part 0: "test:empty"
bundle2-output: header chunk size: 17
bundle2-output: closing payload chunk
bundle2-output: bundle part: "test:empty"
bundle2-output-part: "test:empty" (advisory) empty payload
bundle2-output: part 1: "test:empty"
bundle2-output: header chunk size: 17
bundle2-output: closing payload chunk
bundle2-output: bundle part: "test:song"
bundle2-output-part: "test:song" (advisory) 178 bytes payload
bundle2-output: part 2: "test:song"
bundle2-output: header chunk size: 16
bundle2-output: payload chunk size: 178
bundle2-output: closing payload chunk
bundle2-output: bundle part: "test:debugreply"
bundle2-output-part: "test:debugreply" (advisory) empty payload
bundle2-output: part 3: "test:debugreply"
bundle2-output: header chunk size: 22
bundle2-output: closing payload chunk
bundle2-output: bundle part: "test:math"
bundle2-output-part: "test:math" (advisory) (params: 2 mandatory 2 advisory) 2 bytes payload
bundle2-output: part 4: "test:math"
bundle2-output: header chunk size: 43
bundle2-output: payload chunk size: 2
bundle2-output: closing payload chunk
bundle2-output: bundle part: "test:song"
bundle2-output-part: "test:song" (advisory) (params: 1 mandatory) empty payload
bundle2-output: part 5: "test:song"
bundle2-output: header chunk size: 29
bundle2-output: closing payload chunk
bundle2-output: bundle part: "test:ping"
bundle2-output-part: "test:ping" (advisory) empty payload
bundle2-output: part 6: "test:ping"
bundle2-output: header chunk size: 16
bundle2-output: closing payload chunk
@ -741,6 +748,7 @@ Support for changegroup
bundle2-output: bundle parameter:
bundle2-output: start of parts
bundle2-output: bundle part: "changegroup"
bundle2-output-part: "changegroup" (advisory) streamed payload
bundle2-output: part 0: "changegroup"
bundle2-output: header chunk size: 18
bundling: 1/4 changesets (25.00%)