mercurial/formatter.py
changeset 29949 e7cacb45c4be
parent 29882 307b20e5e505
child 30560 783016005122
--- a/mercurial/formatter.py	Tue Aug 30 15:55:07 2016 -0400
+++ b/mercurial/formatter.py	Mon Aug 29 17:19:09 2016 +0200
@@ -57,10 +57,6 @@
     def __exit__(self, exctype, excvalue, traceback):
         if exctype is None:
             self.end()
-    def __nonzero__(self):
-        '''return False if we're not doing real templating so we can
-        skip extra work'''
-        return True
     def _showitem(self):
         '''show a formatted item once all data is collected'''
         pass
@@ -96,6 +92,9 @@
     def plain(self, text, **opts):
         '''show raw text for non-templated mode'''
         pass
+    def isplain(self):
+        '''check for plain formatter usage'''
+        return False
     def nested(self, field):
         '''sub formatter to store nested data in the specified field'''
         self._item[field] = data = []
@@ -142,8 +141,6 @@
             self.hexfunc = hex
         else:
             self.hexfunc = short
-    def __nonzero__(self):
-        return False
     def startitem(self):
         pass
     def data(self, **data):
@@ -156,6 +153,8 @@
             self._ui.write(deftext % fielddata, **opts)
     def plain(self, text, **opts):
         self._ui.write(text, **opts)
+    def isplain(self):
+        return True
     def nested(self, field):
         # nested data will be directly written to ui
         return self