changeset 40277:1159031ada1e

formatter: make debug output prettier "(glob)" won't be needed since pprintgen() can print dict items in stable order.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 14 Oct 2018 07:25:01 +0200
parents be57c7019c70
children 125fc478719f
files mercurial/formatter.py tests/test-status.t
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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