diff mercurial/formatter.py @ 46769:67a2ecea8bd9

debugdiscovery: also integrate the discovery output in the json one We add a way for formatter to informs code that free output is unwanted, and we incorporate it in the json output. Differential Revision: https://phab.mercurial-scm.org/D10224
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 15 Mar 2021 17:09:42 +0100
parents 4aa484efc926
children d4ba4d51f85f
line wrap: on
line diff
--- a/mercurial/formatter.py	Mon Mar 15 16:55:03 2021 +0100
+++ b/mercurial/formatter.py	Mon Mar 15 17:09:42 2021 +0100
@@ -178,6 +178,11 @@
 
 
 class baseformatter(object):
+
+    # set to True if the formater output a strict format that does not support
+    # arbitrary output in the stream.
+    strict_format = False
+
     def __init__(self, ui, topic, opts, converter):
         self._ui = ui
         self._topic = topic
@@ -418,6 +423,9 @@
 
 
 class jsonformatter(baseformatter):
+
+    strict_format = True
+
     def __init__(self, ui, out, topic, opts):
         baseformatter.__init__(self, ui, topic, opts, _nullconverter)
         self._out = out