mercurial/commands.py
changeset 43489 93f74a7d3f07
parent 43485 13b8097dccbf
parent 43336 a71578ec6257
child 43554 9f70512ae2cf
--- a/mercurial/commands.py	Mon Nov 04 00:16:44 2019 +0100
+++ b/mercurial/commands.py	Tue Nov 05 13:19:24 2019 -0800
@@ -2267,7 +2267,13 @@
             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)
+        elif isinstance(defaultvalue, list) and all(
+            formatter.isprintable(e) for e in defaultvalue
+        ):
+            fm.data(defaultvalue=fm.formatlist(defaultvalue, name=b'value'))
+        # TODO: no idea how to process unsupported defaultvalue types
         matched = True
     fm.end()
     if matched: