# HG changeset patch # User Martin von Zweigbergk # Date 2017-03-09 23:38:00 # Node ID 59d09565ac7707e7a631355fa8f7280c86d656d4 # Parent f5c71e98f0f7650e943ada9924d61c4cdf5d787b 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. diff --git a/mercurial/formatter.py b/mercurial/formatter.py --- a/mercurial/formatter.py +++ b/mercurial/formatter.py @@ -305,10 +305,10 @@ class jsonformatter(baseformatter): 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(",")