Show More
@@ -353,7 +353,7 def processbundle(repo, unbundler, trans | |||||
353 | try: |
|
353 | try: | |
354 | for nbpart, part in iterparts: |
|
354 | for nbpart, part in iterparts: | |
355 | _processpart(op, part) |
|
355 | _processpart(op, part) | |
356 |
except |
|
356 | except Exception as exc: | |
357 | for nbpart, part in iterparts: |
|
357 | for nbpart, part in iterparts: | |
358 | # consume the bundle content |
|
358 | # consume the bundle content | |
359 | part.seek(0, 2) |
|
359 | part.seek(0, 2) | |
@@ -382,6 +382,7 def _processpart(op, part): | |||||
382 | The part is guaranteed to have been fully consumed when the function exits |
|
382 | The part is guaranteed to have been fully consumed when the function exits | |
383 | (even if an exception is raised).""" |
|
383 | (even if an exception is raised).""" | |
384 | status = 'unknown' # used by debug output |
|
384 | status = 'unknown' # used by debug output | |
|
385 | hardabort = False | |||
385 | try: |
|
386 | try: | |
386 | try: |
|
387 | try: | |
387 | handler = parthandlermapping.get(part.type) |
|
388 | handler = parthandlermapping.get(part.type) | |
@@ -436,8 +437,14 def _processpart(op, part): | |||||
436 | outpart = op.reply.newpart('output', data=output, |
|
437 | outpart = op.reply.newpart('output', data=output, | |
437 | mandatory=False) |
|
438 | mandatory=False) | |
438 | outpart.addparam('in-reply-to', str(part.id), mandatory=False) |
|
439 | outpart.addparam('in-reply-to', str(part.id), mandatory=False) | |
|
440 | # If exiting or interrupted, do not attempt to seek the stream in the | |||
|
441 | # finally block below. This makes abort faster. | |||
|
442 | except (SystemExit, KeyboardInterrupt): | |||
|
443 | hardabort = True | |||
|
444 | raise | |||
439 | finally: |
|
445 | finally: | |
440 | # consume the part content to not corrupt the stream. |
|
446 | # consume the part content to not corrupt the stream. | |
|
447 | if not hardabort: | |||
441 | part.seek(0, 2) |
|
448 | part.seek(0, 2) | |
442 |
|
449 | |||
443 |
|
450 |
General Comments 0
You need to be logged in to leave comments.
Login now