changeset 3080:e270cbd4aa20

Fixed OSError "No such file or directory: None" and make IOError consistent. The None error occurs when the current working directory is no longer available, e.g. because it was removed in another shell.
author Thomas Arendsen Hein <thomas@intevation.de>
date Mon, 11 Sep 2006 10:23:23 +0200
parents 4c9fcb5e3b82
children 760414dc7ac6
files mercurial/commands.py tests/test-command-template.out tests/test-ro-message.out
diffstat 3 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Mon Sep 11 10:08:30 2006 +0200
+++ b/mercurial/commands.py	Mon Sep 11 10:23:23 2006 +0200
@@ -3473,13 +3473,13 @@
                 u.warn(_("broken pipe\n"))
         elif getattr(inst, "strerror", None):
             if getattr(inst, "filename", None):
-                u.warn(_("abort: %s - %s\n") % (inst.strerror, inst.filename))
+                u.warn(_("abort: %s: %s\n") % (inst.strerror, inst.filename))
             else:
                 u.warn(_("abort: %s\n") % inst.strerror)
         else:
             raise
     except OSError, inst:
-        if hasattr(inst, "filename"):
+        if getattr(inst, "filename", None):
             u.warn(_("abort: %s: %s\n") % (inst.strerror, inst.filename))
         else:
             u.warn(_("abort: %s\n") % inst.strerror)
--- a/tests/test-command-template.out	Mon Sep 11 10:08:30 2006 +0200
+++ b/tests/test-command-template.out	Mon Sep 11 10:23:23 2006 +0200
@@ -59,9 +59,9 @@
   line 1
 
 # error if style not readable
-abort: Permission denied - ./q
+abort: Permission denied: ./q
 # error if no style
-abort: No such file or directory - notexist
+abort: No such file or directory: notexist
 # error if style missing key
 abort: ./t: no key named 'changeset'
 # error if include fails
--- a/tests/test-ro-message.out	Mon Sep 11 10:08:30 2006 +0200
+++ b/tests/test-ro-message.out	Mon Sep 11 10:23:23 2006 +0200
@@ -1,3 +1,3 @@
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-abort: Permission denied - test-ro-message/b/vehicle
+abort: Permission denied: test-ro-message/b/vehicle