Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/sshpeer.py @ 46710:fa30292b680b
sshpeer: don't fail forwarding output from closed connections
The test still shows an internal error, but one that happens
further along.
Differential Revision: https://phab.mercurial-scm.org/D10073
author | Valentin Gatien-Baron <vgatien-baron@janestreet.com> |
---|---|
date | Thu, 25 Feb 2021 10:00:08 -0500 |
parents | a4c19a162615 |
children | d4ba4d51f85f |
comparison
equal
deleted
inserted
replaced
46709:fe36ce0fbcdd | 46710:fa30292b680b |
---|---|
38 | 38 |
39 def _forwardoutput(ui, pipe, warn=False): | 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 and not pipe.closed: |
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 display = ui.warn if warn else ui.status |
47 for l in s.splitlines(): | 47 for l in s.splitlines(): |
48 display(_(b"remote: "), l, b'\n') | 48 display(_(b"remote: "), l, b'\n') |