formatter: make debug output prettier
authorYuya Nishihara <yuya@tcha.org>
Sun, 14 Oct 2018 07:25:01 +0200
changeset 40277 1159031ada1e
parent 40276 be57c7019c70
child 40278 125fc478719f
formatter: make debug output prettier "(glob)" won't be needed since pprintgen() can print dict items in stable order.
mercurial/formatter.py
tests/test-status.t
--- a/mercurial/formatter.py	Sun Oct 14 07:23:02 2018 +0200
+++ b/mercurial/formatter.py	Sun Oct 14 07:25:01 2018 +0200
@@ -324,7 +324,8 @@
         self._out = out
         self._out.write("%s = [\n" % self._topic)
     def _showitem(self):
-        self._out.write('    %s,\n' % stringutil.pprint(self._item))
+        self._out.write('    %s,\n'
+                        % stringutil.pprint(self._item, indent=4, level=1))
     def end(self):
         baseformatter.end(self)
         self._out.write("]\n")
--- a/tests/test-status.t	Sun Oct 14 07:23:02 2018 +0200
+++ b/tests/test-status.t	Sun Oct 14 07:25:01 2018 +0200
@@ -528,7 +528,10 @@
 
   $ hg status --config ui.formatdebug=True --rev 1 1
   status = [
-      {*'path': '1/2/3/4/5/b.txt'*}, (glob)
+      {
+          'path': '1/2/3/4/5/b.txt',
+          'status': 'R'
+      },
   ]
 
 #if windows