[PATCH stable] rebase: add return codes

Martin Geisler mg at aragost.com
Fri May 21 03:17:29 CDT 2010


Jason Harris <jason at jasonfharris.com> writes:

> I think the grep code might be a bit more exceptional in this regard.
> Moreover Mercurial is a *vastly* *vastly* more complicated program
> than grep. Thus since grep returns 0 or 1, it doesn't simply follow
> that Mercurial should follow this. Just returning 0, 1, or 255, when
> GUI clients are meant to connect to this and "do the right thing" is
> well not quite detailed enough on Mercurial's part.
>
> If you look at for instance:
> http://www.freebsd.org/cgi/man.cgi?query=sysexits&sektion=3

Yeah, I know about those exit codes and they are even part of the os
module in Python (at least on Unix).

> You will see a lot of detailed codes. It would be nice if the
> Mercurial exit codes where broken down a little more into something
> like:
>
> 0: success
> 2: empty result
> 3: no action taken
> 4: unresolved files
> 5: uncommitted changes
> 6: unreachable server
> ...
>
> I am sure you devs can come up with a nice group...

Don't you think you would still need code to parse the output in order
to give proper error messages to the user?

> Still at least I have some description now so I shouldn't complain too
> loudly :)



-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://aragost.com/mercurial/


More information about the Mercurial-devel mailing list