mercurial exit codes
Greg Ward
greg-hg at gerg.ca
Fri Jun 5 22:17:58 CDT 2009
On Fri, Jun 5, 2009 at 8:22 AM, <mail at fabiantriefenbach.de> wrote:
> can I find a documentation of the hg commands and their return values?
> I'm writing a lot batchfiles to automate a workflow on windows and
> would like to use the %errorlevel% variable after calling hg commands.
> But I'm a bit confused which values to expect. So, maybe youcan help me
> out which commands return a value and under which conditions? Do you
> return more than just an error/no error information?
Unfortunately, this appears to be a bit haphazard and undisciplined.
And undocumented AFAIK. Have you searched the wiki? You might do the
community a service and create a wiki page to document this stuff.
The best source of information is the souce code:
mercurial/commands.py. The exit status of a command "hg foo" is the
return value of function foo() in that module.
(I believe a function with no return value ends up with an exit status
of 0. Arguably such command functions should be fixed to explicitly
"return 0".)
Greg
More information about the Mercurial
mailing list