changeset 45058:f43bc4ce0d69

cmdserver: document message-encodings and channel output options While writing the previous patch, I noticed these options are undocumented. In my testing, a separate status/error message channel works well in GUI frontend as we no longer have to sort out data and message from mixed outputs. So let's mark it as not experimental.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 28 Jun 2020 17:32:32 +0900
parents d6e99a446eea
children 79f6f9fa18c1
files mercurial/commandserver.py mercurial/configitems.py mercurial/helptext/config.txt
diffstat 3 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commandserver.py	Sat Jun 27 21:46:23 2020 +0900
+++ b/mercurial/commandserver.py	Sun Jun 28 17:32:32 2020 +0900
@@ -191,7 +191,6 @@
 
 
 def _selectmessageencoder(ui):
-    # experimental config: cmdserver.message-encodings
     encnames = ui.configlist(b'cmdserver', b'message-encodings')
     for n in encnames:
         f = _messageencoders.get(n)
@@ -234,9 +233,6 @@
             self.ui = self.ui.copy()
             setuplogging(self.ui, repo=None, fp=self.cdebug)
 
-        # TODO: add this to help/config.txt when stabilized
-        # ``channel``
-        #   Use separate channel for structured output. (Command-server only)
         self.cmsg = None
         if ui.config(b'ui', b'message-output') == b'channel':
             encname, encfn = _selectmessageencoder(ui)
--- a/mercurial/configitems.py	Sat Jun 27 21:46:23 2020 +0900
+++ b/mercurial/configitems.py	Sun Jun 28 17:32:32 2020 +0900
@@ -204,7 +204,7 @@
     b'cmdserver', b'max-repo-cache', default=0, experimental=True,
 )
 coreconfigitem(
-    b'cmdserver', b'message-encodings', default=list, experimental=True,
+    b'cmdserver', b'message-encodings', default=list,
 )
 coreconfigitem(
     b'cmdserver',
--- a/mercurial/helptext/config.txt	Sat Jun 27 21:46:23 2020 +0900
+++ b/mercurial/helptext/config.txt	Sun Jun 28 17:32:32 2020 +0900
@@ -413,6 +413,12 @@
 
 Controls command server settings. (ADVANCED)
 
+``message-encodings``
+    List of encodings for the ``m`` (message) channel. The first encoding
+    supported by the server will be selected and advertised in the hello
+    message. This is useful only when ``ui.message-output`` is set to
+    ``channel``. Supported encodings are ``cbor``.
+
 ``shutdown-on-interrupt``
     If set to false, the server's main loop will continue running after
     SIGINT received. ``runcommand`` requests can still be interrupted by
@@ -2383,6 +2389,8 @@
 ``message-output``
     Where to write status and error messages. (default: ``stdio``)
 
+    ``channel``
+      Use separate channel for structured output. (Command-server only)
     ``stderr``
       Everything to stderr.
     ``stdio``