From patchwork Mon Mar 16 14:04:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3,of,4,RFC,V2] formatter: convert None to json null From: Yuya Nishihara X-Patchwork-Id: 8094 Message-Id: To: mercurial-devel@selenic.com Date: Mon, 16 Mar 2015 23:04:32 +0900 # HG changeset patch # User Yuya Nishihara # Date 1410960874 -32400 # Wed Sep 17 22:34:34 2014 +0900 # Node ID cdf011561f3cac5e4f44a9811ec4354ebb471867 # Parent 3e97838d4eaa3f4f5131f1f1997ead72acc81aad formatter: convert None to json null It will be used by "annotate" command to represent the workingctx revision. diff --git a/mercurial/formatter.py b/mercurial/formatter.py --- a/mercurial/formatter.py +++ b/mercurial/formatter.py @@ -98,6 +98,8 @@ class pickleformatter(baseformatter): def _jsonifyobj(v): if isinstance(v, tuple): return '[' + ', '.join(_jsonifyobj(e) for e in v) + ']' + elif v is None: + return 'null' elif v is True: return 'true' elif v is False: