formatter: convert booleans to json
authorYuya Nishihara <yuya@tcha.org>
Thu, 02 Oct 2014 23:20:59 +0900
changeset 22674 06c8b58647b9
parent 22673 16a46003b50c
child 22675 4e64d255f1a8
formatter: convert booleans to json It will be used in branches output.
mercurial/formatter.py
--- a/mercurial/formatter.py	Wed Oct 01 03:42:00 2014 +0200
+++ b/mercurial/formatter.py	Thu Oct 02 23:20:59 2014 +0900
@@ -91,6 +91,10 @@
 def _jsonifyobj(v):
     if isinstance(v, tuple):
         return '[' + ', '.join(_jsonifyobj(e) for e in v) + ']'
+    elif v is True:
+        return 'true'
+    elif v is False:
+        return 'false'
     elif isinstance(v, (int, float)):
         return str(v)
     else: