Comments
Patch
@@ -326,17 +326,18 @@ def processbundle(repo, unbundler, trans
msg.append(' no-transaction')
else:
msg.append(' with-transaction')
msg.append('\n')
repo.ui.debug(''.join(msg))
- iterparts = unbundler.iterparts()
+ iterparts = enumerate(unbundler.iterparts())
part = None
+ nbpart = 0
try:
- for part in iterparts:
+ for nbpart, part in iterparts:
_processpart(op, part)
except BaseException, exc:
- for part in iterparts:
+ for nbpart, part in iterparts:
# consume the bundle content
part.seek(0, 2)
# Small hack to let caller code distinguish exceptions from bundle2
# processing from processing the old format. This is mostly
# needed to handle different return codes to unbundle according to the
@@ -346,10 +347,13 @@ def processbundle(repo, unbundler, trans
salvaged = []
if op.reply is not None:
salvaged = op.reply.salvageoutput()
exc._bundle2salvagedoutput = salvaged
raise
+ finally:
+ repo.ui.debug('bundle2-input-bundle: %i parts total\n' % nbpart)
+
return op
def _processpart(op, part):
"""process a single part from a bundle
@@ -603,10 +603,11 @@ Process the bundle
bundle2-input: found a handler for part 'test:ping'
received ping request (id 6)
bundle2-input: payload chunk size: 0
bundle2-input: part header size: 0
bundle2-input: end of bundle2 stream
+ bundle2-input-bundle: 6 parts total
0 unread bytes
3 total verses sung
Unbundle with an unknown mandatory part
(should abort)