Mercurial > public > mercurial-scm > hg
comparison mercurial/bundle2.py @ 24743:a2ef1dc3b59b
bundle2: flush output in a part in all cases
We want to preserve output even when the unbundling fails (eg: hook output). So
we must make sure that everything we have is flushed into the reply bundle.
(This is related to issue4594)
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Sat, 11 Apr 2015 17:30:45 -0400 |
parents | bb67e52362d6 |
children | 2ec894582ea2 |
comparison
equal
deleted
inserted
replaced
24742:39ee0444e27c | 24743:a2ef1dc3b59b |
---|---|
355 try: | 355 try: |
356 handler(op, part) | 356 handler(op, part) |
357 finally: | 357 finally: |
358 if output is not None: | 358 if output is not None: |
359 output = op.ui.popbuffer() | 359 output = op.ui.popbuffer() |
360 if output: | 360 if output: |
361 outpart = op.reply.newpart('output', data=output, | 361 outpart = op.reply.newpart('output', data=output, |
362 mandatory=False) | 362 mandatory=False) |
363 outpart.addparam('in-reply-to', str(part.id), mandatory=False) | 363 outpart.addparam('in-reply-to', str(part.id), mandatory=False) |
364 finally: | 364 finally: |
365 # consume the part content to not corrupt the stream. | 365 # consume the part content to not corrupt the stream. |
366 part.seek(0, 2) | 366 part.seek(0, 2) |
367 | 367 |
368 | 368 |