sshpeer: break "OutOfBandError" feature for ssh (BC)
authorPierre-Yves David <pierre-yves.david@fb.com>
Wed, 20 May 2015 12:33:12 -0500
changeset 25243 d65243d28749
parent 25242 8de7d1d937b3
child 25244 cf90764f40a4
sshpeer: break "OutOfBandError" feature for ssh (BC) When we'll be using the ssh's 'stderr' for realtime output successfully, it will no longer be possible to use 'stderr' to carry the error message (because it is already consumed by the real time output logic. This feature is very rarely used (test says largefile only) and I think breaking its output pattern is worth the benefit of having real time output with ssh.
mercurial/sshpeer.py
tests/test-largefiles-wireproto.t
--- a/mercurial/sshpeer.py	Wed May 20 18:17:40 2015 -0500
+++ b/mercurial/sshpeer.py	Wed May 20 12:33:12 2015 -0500
@@ -195,16 +195,9 @@
     def _recv(self):
         l = self.pipei.readline()
         if l == '\n':
-            err = []
-            while True:
-                line = self.pipee.readline()
-                if line == '-\n':
-                    break
-                err.extend([line])
-            if len(err) > 0:
-                # strip the trailing newline added to the last line server-side
-                err[-1] = err[-1][:-1]
-            self._abort(error.OutOfBandError(*err))
+            self.readerr()
+            msg = _('check previous remote output')
+            self._abort(error.OutOfBandError(hint=msg))
         self.readerr()
         try:
             l = int(l)
--- a/tests/test-largefiles-wireproto.t	Wed May 20 18:17:40 2015 -0500
+++ b/tests/test-largefiles-wireproto.t	Wed May 20 12:33:12 2015 -0500
@@ -111,11 +111,14 @@
 
 vanilla clients locked out from largefiles ssh repos
   $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
-  abort: remote error:
-  
-  This repository uses the largefiles extension.
-  
-  Please enable it in your Mercurial config file.
+  remote: 
+  remote: This repository uses the largefiles extension.
+  remote: 
+  remote: Please enable it in your Mercurial config file.
+  remote: 
+  remote: -
+  abort: remote error
+  (check previous remote output)
   [255]
 
 #if serve