From patchwork Thu Apr 21 06:09:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1,of,2,STABLE] formatter: handle nested dictionaries From: timeless X-Patchwork-Id: 14754 Message-Id: <24fa6b119f160b3adf25.1461218946@gcc2-power8.osuosl.org> To: mercurial-devel@mercurial-scm.org Date: Thu, 21 Apr 2016 06:09:06 +0000 # HG changeset patch # User timeless # Date 1461210821 0 # Thu Apr 21 03:53:41 2016 +0000 # Branch stable # Node ID 24fa6b119f160b3adf25c1018bb322ca4db9b948 # Parent 1967c6b714e6bc2e3ffe7ea0197a5f2b42b53320 # Available At bb://timeless/mercurial-crew # hg pull bb://timeless/mercurial-crew -r 24fa6b119f16 formatter: handle nested dictionaries diff -r 1967c6b714e6 -r 24fa6b119f16 mercurial/formatter.py --- a/mercurial/formatter.py Fri Apr 15 14:28:26 2016 -0700 +++ b/mercurial/formatter.py Thu Apr 21 03:53:41 2016 +0000 @@ -120,6 +120,10 @@ return 'false' elif isinstance(v, (int, float)): return str(v) + elif isinstance(v, dict): + return ('{' + ', '.join('%s: %s' % + (_jsonifyobj(k), _jsonifyobj(v[k])) for k in v) + + '}') else: return '"%s"' % encoding.jsonescape(v)