diff mercurial/formatter.py @ 22674:06c8b58647b9

formatter: convert booleans to json It will be used in branches output.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 02 Oct 2014 23:20:59 +0900
parents a0829ec34dbd
children cb28d2b3db0b
line wrap: on
line diff
--- 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: