diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py --- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -183,8 +183,8 @@ def _runcatch(req): else: raise except OSError, inst: - if getattr(inst, "filename", None): - ui.warn(_("abort: %s: %s\n") % (inst.strerror, inst.filename)) + if getattr(inst, "filename", None) is not None: + ui.warn(_("abort: %s: '%s'\n") % (inst.strerror, inst.filename)) else: ui.warn(_("abort: %s\n") % inst.strerror) except KeyboardInterrupt: diff --git a/tests/test-audit-path.t b/tests/test-audit-path.t --- a/tests/test-audit-path.t +++ b/tests/test-audit-path.t @@ -86,7 +86,7 @@ attack /tmp/test $ hg manifest -r4 /tmp/test $ hg update -Cr4 - abort: *: $TESTTMP/target//tmp/test (glob) + abort: *: '$TESTTMP/target//tmp/test' (glob) [255] $ cd .. diff --git a/tests/test-clone.t b/tests/test-clone.t --- a/tests/test-clone.t +++ b/tests/test-clone.t @@ -558,7 +558,7 @@ Inaccessible destination $ hg init b $ cd b $ hg clone . ../a - abort: Permission denied: ../a + abort: Permission denied: '../a' [255] $ cd .. $ chmod 700 a diff --git a/tests/test-convert.t b/tests/test-convert.t --- a/tests/test-convert.t +++ b/tests/test-convert.t @@ -316,7 +316,7 @@ conversion to dir without permissions sh $ chmod 000 bogusdir $ hg convert a bogusdir - abort: Permission denied: bogusdir + abort: Permission denied: 'bogusdir' [255] user permissions should succeed diff --git a/tests/test-dispatch.t b/tests/test-dispatch.t --- a/tests/test-dispatch.t +++ b/tests/test-dispatch.t @@ -46,6 +46,12 @@ Missing arg: $ cd "$TESTTMP" +OSError ... and with filename even when it is empty + + $ hg -R a archive '' + abort: No such file or directory: '' + [255] + #if no-outer-repo No repo: