formatter: set _first on formatter, not ui
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 09 Mar 2017 15:38:00 -0800
changeset 31307 59d09565ac77
parent 31306 f5c71e98f0f7
child 31308 90e69badb125
formatter: set _first on formatter, not ui The _first field is used for tracking when to emit a separator between items. It seems like it's clearly formatter state, not ui state, so let's move it there.
mercurial/formatter.py
--- a/mercurial/formatter.py	Fri Mar 10 23:07:20 2017 -0800
+++ b/mercurial/formatter.py	Thu Mar 09 15:38:00 2017 -0800
@@ -305,10 +305,10 @@
         baseformatter.__init__(self, ui, topic, opts, _nullconverter)
         self._out = out
         self._out.write("[")
-        self._ui._first = True
+        self._first = True
     def _showitem(self):
-        if self._ui._first:
-            self._ui._first = False
+        if self._first:
+            self._first = False
         else:
             self._out.write(",")