changeset 26350:ccab61d84ea7

dispatch: stop warning about EPIPE in --debug mode It seems silly for "hg --debug manifest | less" to print a scary message after the user hits "q" in less. hg should just exit silently instead, since EPIPE on stdout is a perfectly reasonable result.
author Daniel Colascione <dancol@fb.com>
date Thu, 24 Sep 2015 10:15:37 +0300
parents 92409f8dff5d
children 8c7d8d5e1e0f
files mercurial/dispatch.py
diffstat 1 files changed, 2 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dispatch.py	Mon Sep 14 17:31:48 2015 -0700
+++ b/mercurial/dispatch.py	Thu Sep 24 10:15:37 2015 +0300
@@ -292,8 +292,7 @@
             ui.warn(_("abort: error: %s\n") % reason)
         elif (util.safehasattr(inst, "args")
               and inst.args and inst.args[0] == errno.EPIPE):
-            if ui.debugflag:
-                ui.warn(_("broken pipe\n"))
+            pass
         elif getattr(inst, "strerror", None):
             if getattr(inst, "filename", None):
                 ui.warn(_("abort: %s: %s\n") % (inst.strerror, inst.filename))
@@ -310,10 +309,7 @@
         try:
             ui.warn(_("interrupted!\n"))
         except IOError as inst:
-            if inst.errno == errno.EPIPE:
-                if ui.debugflag:
-                    ui.warn(_("\nbroken pipe\n"))
-            else:
+            if inst.errno != errno.EPIPE:
                 raise
     except MemoryError:
         ui.warn(_("abort: out of memory\n"))