##// END OF EJS Templates
sshpeer: make client print (likely) server errors on stderr (BC)...
Valentin Gatien-Baron -
r45387:5d77f571 default
parent child Browse files
Show More
@@ -36,15 +36,16 b' def _serverquote(s):'
36 return b"'%s'" % s.replace(b"'", b"'\\''")
36 return b"'%s'" % s.replace(b"'", b"'\\''")
37
37
38
38
39 def _forwardoutput(ui, pipe):
39 def _forwardoutput(ui, pipe, warn=False):
40 """display all data currently available on pipe as remote output.
40 """display all data currently available on pipe as remote output.
41
41
42 This is non blocking."""
42 This is non blocking."""
43 if pipe:
43 if pipe:
44 s = procutil.readpipe(pipe)
44 s = procutil.readpipe(pipe)
45 if s:
45 if s:
46 display = ui.warn if warn else ui.status
46 for l in s.splitlines():
47 for l in s.splitlines():
47 ui.status(_(b"remote: "), l, b'\n')
48 display(_(b"remote: "), l, b'\n')
48
49
49
50
50 class doublepipe(object):
51 class doublepipe(object):
@@ -204,8 +205,12 b' def _clientcapabilities():'
204
205
205 def _performhandshake(ui, stdin, stdout, stderr):
206 def _performhandshake(ui, stdin, stdout, stderr):
206 def badresponse():
207 def badresponse():
207 # Flush any output on stderr.
208 # Flush any output on stderr. In general, the stderr contains errors
208 _forwardoutput(ui, stderr)
209 # from the remote (ssh errors, some hg errors), and status indications
210 # (like "adding changes"), with no current way to tell them apart.
211 # Here we failed so early that it's almost certainly only errors, so
212 # use warn=True so -q doesn't hide them.
213 _forwardoutput(ui, stderr, warn=True)
209
214
210 msg = _(b'no suitable response from remote hg')
215 msg = _(b'no suitable response from remote hg')
211 hint = ui.config(b'ui', b'ssherrorhint')
216 hint = ui.config(b'ui', b'ssherrorhint')
@@ -307,7 +312,7 b' def _performhandshake(ui, stdin, stdout,'
307 while lines[-1] and max_noise:
312 while lines[-1] and max_noise:
308 try:
313 try:
309 l = stdout.readline()
314 l = stdout.readline()
310 _forwardoutput(ui, stderr)
315 _forwardoutput(ui, stderr, warn=True)
311
316
312 # Look for reply to protocol upgrade request. It has a token
317 # Look for reply to protocol upgrade request. It has a token
313 # in it, so there should be no false positives.
318 # in it, so there should be no false positives.
@@ -374,7 +379,7 b' def _performhandshake(ui, stdin, stdout,'
374 badresponse()
379 badresponse()
375
380
376 # Flush any output on stderr before proceeding.
381 # Flush any output on stderr before proceeding.
377 _forwardoutput(ui, stderr)
382 _forwardoutput(ui, stderr, warn=True)
378
383
379 return protoname, caps
384 return protoname, caps
380
385
@@ -47,6 +47,7 b' repo not found error'
47 abort: no suitable response from remote hg!
47 abort: no suitable response from remote hg!
48 [255]
48 [255]
49 $ hg clone -q -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local
49 $ hg clone -q -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/nonexistent local
50 remote: abort: repository nonexistent not found!
50 abort: no suitable response from remote hg!
51 abort: no suitable response from remote hg!
51 [255]
52 [255]
52
53
General Comments 0
You need to be logged in to leave comments. Login now