Mercurial > public > mercurial-scm > hg-stable
diff mercurial/configitems.py @ 40594:840cd57cde32
ui: add config knob to redirect status messages to stderr (API)
This option can be used to isolate structured output from status messages.
For now, "stdio" (stdout/err pair) and "stderr" are supported. In future
patches, I'll add the "channel" option which will send status messages to
a separate command-server channel with some metadata attached, maybe in
CBOR encoding.
This is a part of the generic templating plan:
https://www.mercurial-scm.org/wiki/GenericTemplatingPlan#Sanity_check_output
.. api::
Status messages may be sent to a dedicated stream depending on
configuration. Don't use ``ui.status()``, etc. as a shorthand for
conditional writes. Use ``ui.write()`` for data output.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 03 Nov 2018 19:42:50 +0900 |
parents | 86dfae98a3a2 |
children | 054d0fcba2c4 |
line wrap: on
line diff
--- a/mercurial/configitems.py Sat Nov 03 20:53:31 2018 +0900 +++ b/mercurial/configitems.py Sat Nov 03 19:42:50 2018 +0900 @@ -1181,6 +1181,9 @@ '{ifeq(branch, "default", "", "{branch} ")}' '- {author|user}: {desc|firstline}') ) +coreconfigitem('ui', 'message-output', + default='stdio', +) coreconfigitem('ui', 'nontty', default=False, )