[PATCH 2 of 2] Made the abort message for IOError nicer when the filename is known

Eric Hopper hopper at omnifarious.org
Mon Sep 26 16:45:48 CDT 2005


# HG changeset patch
# User Eric Hopper <hopper at omnifarious.org>
# Node ID 88c65f25af403e30dd8e44142bb2a6ceb81e166f
# Parent  d8194057f6dca0b18d53bbb9c0e26a48981d9169
Made the abort message for IOError nicer when the filename is known.

diff -r d8194057f6dc -r 88c65f25af40 mercurial/commands.py
--- a/mercurial/commands.py	Mon Sep 26 21:37:30 2005
+++ b/mercurial/commands.py	Mon Sep 26 21:38:43 2005
@@ -2178,7 +2178,10 @@
             if u.debugflag:
                 u.warn("broken pipe\n")
         elif getattr(inst, "strerror", None):
-            u.warn("abort: %s\n" % inst.strerror)
+            if getattr(inst, "filename", None):
+                u.warn("abort: %s - %s\n" % (inst.strerror, inst.filename))
+            else:
+                u.warn("abort: %s\n" % inst.strerror)
         else:
             raise
     except OSError, inst:


More information about the Mercurial mailing list