Fwd: Re: How hg signals error and aux messages
Matt Mackall
mpm at selenic.com
Tue Jan 29 21:09:13 UTC 2013
On Tue, 2013-01-29 at 15:25 +0000, Jan Vrany wrote:
> Yes, I've read this, but unfortunately I haven't found answers
> to following questions:
>
> - Is an error alwyas indicated by a line to stderr (or error channel)
> starting with 'abort: '?
Errors are always on stderr. They may or may not be prefixed with abort.
Warnings also appear on stderr, usually prefixed by "warning:".
> - Is an error always indicated on stderr (or error channel) before
> command output?
Generally -after-.
> - Where are auxiliary messages such as 'invalidating branch cache (tip
> differs') written?
Generally stdout.
> Also, I haven't found command's output "grammar" - how the output
> (stdout or 'o'utput channel) of an hg merge command (for instance)
> look like.
The code and the test suite is the current spec. If you'd like to turn
that spec into a format you think is more convenient, be my guest. It
doesn't see to be a priority for anyone else.
> Actually, I do have a feeling and my brief experiments shows,
> that command server solves only the problem of startup (and
> maybe language neutrality) and does not specify the output of
> individual HG commands like merge, push, update. Am I wrong?
Not precisely. It is our position that the command line is and has
always been the defacto public, stable API. It's thus not the mission of
the _command server_ to document the API, just to make it available more
conveniently.
Recommend you look at python-hglib for an example of how to translate hg
output into native data structures. We continually regression test
python-hglib against multiple versions of hg.
http://www.selenic.com/repo/python-hglib
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial
mailing list