wireproto: handle other server output in pushkey
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Mon, 12 Dec 2011 15:16:58 +0100
changeset 15652 ca6accdad79c
parent 15651 e69a3cdad37e
child 15653 93c77d5b9752
wireproto: handle other server output in pushkey Remote side may add useful information alongside failure return code. For example "ssl is required". This patch mirror what is done for the unbundle command.
mercurial/wireproto.py
--- a/mercurial/wireproto.py	Thu Dec 15 11:45:01 2011 +0100
+++ b/mercurial/wireproto.py	Mon Dec 12 15:16:58 2011 +0100
@@ -239,11 +239,14 @@
                      old=encoding.fromlocal(old),
                      new=encoding.fromlocal(new)), f
         d = f.value
+        d, output = d.split('\n', 1)
         try:
             d = bool(int(d))
         except ValueError:
             raise error.ResponseError(
                 _('push failed (unexpected response):'), d)
+        for l in output.splitlines(True):
+            self.ui.status(_('remote: '), l)
         yield d
 
     @batchable