From patchwork Thu Sep 24 07:24:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: dispatch: stop warning about EPIPE in --debug mode From: "Daniel Colascione \(SEATTLE\)" X-Patchwork-Id: 10609 Message-Id: <5603A528.9050108@fb.com> To: Date: Thu, 24 Sep 2015 10:24:24 +0300 # HG changeset patch # User Daniel Colascione # Date 1443078937 -10800 # Thu Sep 24 10:15:37 2015 +0300 # Node ID ef903d0c1928d9409640485e0908beb40414fe7a # Parent 60558319ce724e8377c56591af3089380753f6de 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. 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")) diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py --- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -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,