changeset 22424:1f72226064b8

formatter: make debug style match Python syntax
author Matt Mackall <mpm@selenic.com>
date Fri, 12 Sep 2014 19:06:11 -0500
parents edf07a804ac4
children 6fd944c204a9
files mercurial/formatter.py tests/test-status.t
diffstat 2 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/formatter.py	Fri Sep 12 18:32:46 2014 -0500
+++ b/mercurial/formatter.py	Fri Sep 12 19:06:11 2014 -0500
@@ -67,12 +67,12 @@
 class debugformatter(baseformatter):
     def __init__(self, ui, topic, opts):
         baseformatter.__init__(self, ui, topic, opts)
-        self._ui.write("%s = {\n" % self._topic)
+        self._ui.write("%s = [\n" % self._topic)
     def _showitem(self):
         self._ui.write("    " + repr(self._item) + ",\n")
     def end(self):
         baseformatter.end(self)
-        self._ui.write("}\n")
+        self._ui.write("]\n")
 
 def formatter(ui, topic, opts):
     if ui.configbool('ui', 'formatdebug'):
--- a/tests/test-status.t	Fri Sep 12 18:32:46 2014 -0500
+++ b/tests/test-status.t	Fri Sep 12 19:06:11 2014 -0500
@@ -350,6 +350,11 @@
   $ hg status -A --rev 1 1
   R 1/2/3/4/5/b.txt
 
+  $ hg status --config ui.formatdebug=True --rev 1 1
+  status = [
+      {*'path': '1/2/3/4/5/b.txt'*}, (glob)
+  ]
+
 #if windows
   $ hg --config ui.slash=false status -A --rev 1 1
   R 1\2\3\4\5\b.txt