[issue1590] Mercurial exit codes doing "log" and "annotate" on unknown files seem a bit inconsistent

Geoff Bache mercurial-bugs at selenic.com
Thu Apr 2 16:24:23 CDT 2009


New submission from Geoff Bache <geoff.bache at pobox.com>:

If you do "hg annotate" or "hg log" on an unknown file, I'd expect an error code
back and a suitable error message. (as e.g. at least cvs, svn and bzr do). In
hg, "hg annotate" gives the error-like message

sofa-pc : hg ann blah
blah: No such file in rev 2822c65c9b31

but still returns 0 exit code.

"hg log blah" writes nothing and returns 0 exit code (again bzr, svn and cvs
write an error and give non-zero exit code)

But then, suddenly:

sofa-pc : hg log -f blah
abort: cannot follow nonexistent file: "blah"
sofa-pc : echo $?
255

The contrast between "hg log" and "hg log -f" seems particularly weird to me.

----------
messages: 8972
nosy: gjb1002
priority: bug
status: unread
title: Mercurial exit codes doing "log" and "annotate" on unknown files seem a bit inconsistent

____________________________________________________
Mercurial issue tracker <mercurial-bugs at selenic.com>
<http://www.selenic.com/mercurial/bts/issue1590>
____________________________________________________



More information about the Mercurial-devel mailing list