# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 2017-05-27 08:44:26
# Node ID e9bf3e132ea9bda24e8073e9e26e3ee79f7f90f9
# Parent  35985d407d49c03fb54740f17d261f2d536ba655

formatter: add nullformatter

This can be used as a placeholder variable.

diff --git a/mercurial/formatter.py b/mercurial/formatter.py
--- a/mercurial/formatter.py
+++ b/mercurial/formatter.py
@@ -207,6 +207,10 @@ class baseformatter(object):
         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):