ignore EPIPE in ui.err_write
It avoids not being able to abort a transaction when a push via ssh fails.
Maybe some other place should ignore EPIPE too.
--- a/mercurial/ui.py Tue Mar 21 23:31:04 2006 -0800
+++ b/mercurial/ui.py Thu Mar 23 23:16:41 2006 +0100
@@ -8,7 +8,7 @@
import ConfigParser
from i18n import gettext as _
from demandload import *
-demandload(globals(), "os re socket sys util tempfile")
+demandload(globals(), "errno os re socket sys tempfile util")
class ui(object):
def __init__(self, verbose=False, debug=False, quiet=False,
@@ -179,9 +179,13 @@
sys.stdout.write(str(a))
def write_err(self, *args):
- if not sys.stdout.closed: sys.stdout.flush()
- for a in args:
- sys.stderr.write(str(a))
+ try:
+ if not sys.stdout.closed: sys.stdout.flush()
+ for a in args:
+ sys.stderr.write(str(a))
+ except IOError, inst:
+ if inst.errno != errno.EPIPE:
+ raise
def flush(self):
try: