changeset 1354:8cf364c65425

Made the abort message for IOError nicer when the filename is known.
author Eric Hopper <hopper@omnifarious.org>
date Tue, 27 Sep 2005 14:58:48 -0700
parents a0c68981a5f4
children 9116fe491b06
files mercurial/commands.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Sep 27 14:58:28 2005 -0700
+++ b/mercurial/commands.py	Tue Sep 27 14:58:48 2005 -0700
@@ -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: