changeset 21133:bef4a2adc532

bundle2: include stderr when capturing handlers output We do not discriminate between stdout and stderr yet. But this will do for now.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 16 Apr 2014 23:18:27 -0400
parents 350dc24a553d
children 2f8c4fa237f5
files mercurial/bundle2.py tests/test-bundle2.t
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundle2.py	Wed Apr 16 23:36:57 2014 -0400
+++ b/mercurial/bundle2.py	Wed Apr 16 23:18:27 2014 -0400
@@ -309,7 +309,7 @@
             # itself represents a defect of a different variety).
             output = None
             if op.reply is not None:
-                op.ui.pushbuffer()
+                op.ui.pushbuffer(error=True)
                 output = ''
             try:
                 handler(op, part)
--- a/tests/test-bundle2.t	Wed Apr 16 23:36:57 2014 -0400
+++ b/tests/test-bundle2.t	Wed Apr 16 23:18:27 2014 -0400
@@ -37,6 +37,7 @@
   > def pinghandler(op, part):
   >     op.ui.write('received ping request (id %i)\n' % part.id)
   >     if op.reply is not None:
+  >         op.ui.write_err('replying to ping request (id %i)\n' % part.id)
   >         rpart = bundle2.bundlepart('test:pong',
   >                                    [('in-reply-to', str(part.id))])
   >         op.reply.addpart(rpart)
@@ -509,7 +510,8 @@
       Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
       Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
       Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
-  \x00\x00\x00\x00\x00\x1e	test:pong\x00\x00\x00\x01\x01\x00\x0b\x01in-reply-to5\x00\x00\x00\x00\x00\x1b\x06output\x00\x00\x00\x02\x00\x01\x0b\x01in-reply-to5\x00\x00\x00\x1dreceived ping request (id 5) (esc)
+  \x00\x00\x00\x00\x00\x1e	test:pong\x00\x00\x00\x01\x01\x00\x0b\x01in-reply-to5\x00\x00\x00\x00\x00\x1b\x06output\x00\x00\x00\x02\x00\x01\x0b\x01in-reply-to5\x00\x00\x00=received ping request (id 5) (esc)
+  replying to ping request (id 5)
   \x00\x00\x00\x00\x00\x00 (no-eol) (esc)
 
 The reply is valid
@@ -527,7 +529,7 @@
     :output:
       mandatory: 0
       advisory: 1
-      payload: 29 bytes
+      payload: 61 bytes
   parts count:   3
 
 Unbundle the reply to get the output:
@@ -538,6 +540,7 @@
   remote:     Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
   remote:     Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
   remote: received ping request (id 5)
+  remote: replying to ping request (id 5)
   0 unread bytes
 
 Support for changegroup