diff mercurial/commands.py @ 43335:242ad45b60b3 stable

config: fix -Tjson to not crash due to unsupported defaultvalue types Maybe it isn't great to ignore unsupported types at all, but otherwise "hg config -Tjson" would crash.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 27 Oct 2019 12:30:59 +0900
parents d782cce137fd
children a71578ec6257
line wrap: on
line diff
--- a/mercurial/commands.py	Sun Oct 27 18:12:24 2019 +0100
+++ b/mercurial/commands.py	Sun Oct 27 12:30:59 2019 +0900
@@ -2267,7 +2267,9 @@
             fm.write(b'value', b'%s\n', value)
         else:
             fm.write(b'name value', b'%s=%s\n', entryname, value)
-        fm.data(defaultvalue=defaultvalue)
+        if formatter.isprintable(defaultvalue):
+            fm.data(defaultvalue=defaultvalue)
+        # TODO: no idea how to process unsupported defaultvalue types
         matched = True
     fm.end()
     if matched: