Mercurial > public > mercurial-scm > hg
comparison mercurial/formatter.py @ 40274:a8b9174517c7
formatter: use stringutil.pprint() in debug output to drop b''
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 14 Oct 2018 06:51:19 +0200 |
parents | 46f9b1d2daf0 |
children | 1159031ada1e |
comparison
equal
deleted
inserted
replaced
40273:3b275f549777 | 40274:a8b9174517c7 |
---|---|
127 templatekw, | 127 templatekw, |
128 templater, | 128 templater, |
129 templateutil, | 129 templateutil, |
130 util, | 130 util, |
131 ) | 131 ) |
132 from .utils import dateutil | 132 from .utils import ( |
133 dateutil, | |
134 stringutil, | |
135 ) | |
133 | 136 |
134 pickle = util.pickle | 137 pickle = util.pickle |
135 | 138 |
136 class _nullconverter(object): | 139 class _nullconverter(object): |
137 '''convert non-primitive data types to be processed by formatter''' | 140 '''convert non-primitive data types to be processed by formatter''' |
319 def __init__(self, ui, out, topic, opts): | 322 def __init__(self, ui, out, topic, opts): |
320 baseformatter.__init__(self, ui, topic, opts, _nullconverter) | 323 baseformatter.__init__(self, ui, topic, opts, _nullconverter) |
321 self._out = out | 324 self._out = out |
322 self._out.write("%s = [\n" % self._topic) | 325 self._out.write("%s = [\n" % self._topic) |
323 def _showitem(self): | 326 def _showitem(self): |
324 self._out.write(' %s,\n' % pycompat.byterepr(self._item)) | 327 self._out.write(' %s,\n' % stringutil.pprint(self._item)) |
325 def end(self): | 328 def end(self): |
326 baseformatter.end(self) | 329 baseformatter.end(self) |
327 self._out.write("]\n") | 330 self._out.write("]\n") |
328 | 331 |
329 class pickleformatter(baseformatter): | 332 class pickleformatter(baseformatter): |