changeset 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 39ee0444e27c
children bedefc611f25
files mercurial/bundle2.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundle2.py	Sat Apr 11 14:44:12 2015 -0400
+++ b/mercurial/bundle2.py	Sat Apr 11 17:30:45 2015 -0400
@@ -357,10 +357,10 @@
         finally:
             if output is not None:
                 output = op.ui.popbuffer()
-        if output:
-            outpart = op.reply.newpart('output', data=output,
-                                       mandatory=False)
-            outpart.addparam('in-reply-to', str(part.id), mandatory=False)
+            if output:
+                outpart = op.reply.newpart('output', data=output,
+                                           mandatory=False)
+                outpart.addparam('in-reply-to', str(part.id), mandatory=False)
     finally:
         # consume the part content to not corrupt the stream.
         part.seek(0, 2)