hg return codes?

Patrick Mézard pmezard at gmail.com
Wed Feb 20 10:07:54 CST 2008


Hello,

BuraphaLinux Server a écrit :
> When I do this:
> 
> bash-3.2$ mkdir a
> bash-3.2$ cd a
> bash-3.2$ hg init
> bash-3.2$ hg add bogus
> bogus: No such file or directory
> bash-3.2$ echo $?
> 0
> 
> I expect some non-zero return code so I can script it, but it seems
> everything returns 0.  Continuing on to show what I mean:
> bash-3.2$ echo 'strange' >a
> bash-3.2$ hg commit -m"bogus"
> nothing changed
> bash-3.2$ echo $?
> 0
> 
> Since everything else seems so nice (I'm a former RCS person, and I
> use mercurial for my private work) I'm wondering if there is some
> switch or configuration file I have set wrong that is preventing
> reasonable return codes from hg.

No, this is a bug, fixed in development repositories:

$ hg init t
$ cd t
$ hg add bogus
bogus does not exist!
$ echo $?
1
$ hg version
Mercurial Distributed SCM (version 4641d2c1cec4)


--
Patrick Mézard


More information about the Mercurial mailing list