formatter: convert None to json null
authorYuya Nishihara <yuya@tcha.org>
Wed, 17 Sep 2014 22:34:34 +0900
changeset 24321 0a714a1f7d5c
parent 24320 b9f7f3eeb99c
child 24322 f263814c72ac
formatter: convert None to json null It will be used by "annotate" command to represent the workingctx revision.
mercurial/formatter.py
--- a/mercurial/formatter.py	Sun Aug 17 11:35:31 2014 +0900
+++ b/mercurial/formatter.py	Wed Sep 17 22:34:34 2014 +0900
@@ -98,6 +98,8 @@
 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: