Mercurial > hg > mercurial-crew
changeset 18227:720308f741cb
dispatch: show empty filename in OSError aborts
Mercurial would sometimes exit with:
abort: No such file or directory
where str of the actual OSError exception was the more helpful:
[Errno 2] No such file or directory: ''
The exception will now always show the filename and quote it:
abort: No such file or directory: ''
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Mon, 07 Jan 2013 02:00:29 +0100 |
parents | fe67db018bd7 |
children | 1528ff6ac7ee |
files | mercurial/dispatch.py tests/test-audit-path.t tests/test-clone.t tests/test-convert.t tests/test-dispatch.t |
diffstat | 5 files changed, 11 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -183,8 +183,8 @@ 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:
--- a/tests/test-audit-path.t +++ b/tests/test-audit-path.t @@ -86,7 +86,7 @@ $ hg manifest -r4 /tmp/test $ hg update -Cr4 - abort: *: $TESTTMP/target//tmp/test (glob) + abort: *: '$TESTTMP/target//tmp/test' (glob) [255] $ cd ..
--- a/tests/test-clone.t +++ b/tests/test-clone.t @@ -558,7 +558,7 @@ $ hg init b $ cd b $ hg clone . ../a - abort: Permission denied: ../a + abort: Permission denied: '../a' [255] $ cd .. $ chmod 700 a