changeset 32581:e9bf3e132ea9

formatter: add nullformatter This can be used as a placeholder variable.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 27 May 2017 17:44:26 +0900
parents 35985d407d49
children 7f4435078a8f
files mercurial/formatter.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/formatter.py	Sat May 27 17:40:18 2017 +0900
+++ b/mercurial/formatter.py	Sat May 27 17:44:26 2017 +0900
@@ -207,6 +207,10 @@
         if self._item is not None:
             self._showitem()
 
+def nullformatter(ui, topic):
+    '''formatter that prints nothing'''
+    return baseformatter(ui, topic, opts={}, converter=_nullconverter)
+
 class _nestedformatter(baseformatter):
     '''build sub items and store them in the parent formatter'''
     def __init__(self, ui, converter, data):