# HG changeset patch # User Thomas Arendsen Hein # Date 1157963003 -7200 # Node ID e270cbd4aa207d020ab6d4585085e1a55d784cf8 # Parent 4c9fcb5e3b8223cfb3981c4259c0b7edf605509c 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. diff -r 4c9fcb5e3b82 -r e270cbd4aa20 mercurial/commands.py --- 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) diff -r 4c9fcb5e3b82 -r e270cbd4aa20 tests/test-command-template.out --- 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 diff -r 4c9fcb5e3b82 -r e270cbd4aa20 tests/test-ro-message.out --- 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