comparison mercurial/sshpeer.py @ 25243:d65243d28749

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.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 20 May 2015 12:33:12 -0500
parents 14ac0c1579cd
children cf90764f40a4
comparison
equal deleted inserted replaced
25242:8de7d1d937b3 25243:d65243d28749
193 return self.pipei 193 return self.pipei
194 194
195 def _recv(self): 195 def _recv(self):
196 l = self.pipei.readline() 196 l = self.pipei.readline()
197 if l == '\n': 197 if l == '\n':
198 err = [] 198 self.readerr()
199 while True: 199 msg = _('check previous remote output')
200 line = self.pipee.readline() 200 self._abort(error.OutOfBandError(hint=msg))
201 if line == '-\n':
202 break
203 err.extend([line])
204 if len(err) > 0:
205 # strip the trailing newline added to the last line server-side
206 err[-1] = err[-1][:-1]
207 self._abort(error.OutOfBandError(*err))
208 self.readerr() 201 self.readerr()
209 try: 202 try:
210 l = int(l) 203 l = int(l)
211 except ValueError: 204 except ValueError:
212 self._abort(error.ResponseError(_("unexpected response:"), l)) 205 self._abort(error.ResponseError(_("unexpected response:"), l))