Mercurial > hg
comparison tests/test-config.t @ 43337:7e20b705da5b stable
formatter: fix handling of None value in templater mapping
For historical reasons, None in mapping dict means there's no such keyword,
and falls back to b"". That's fine in log templates where mapping item is
generally a callable returning a value (which may be None,) but the formatter
directly puts an "evaluated" value in the mapping. So the None value has
to be lifted to wrappedvalue(None) to avoid confusion in the template engine.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 27 Oct 2019 12:49:09 +0900 |
parents | a71578ec6257 |
children | 0883413e09bc |
comparison
equal
deleted
inserted
replaced
43336:a71578ec6257 | 43337:7e20b705da5b |
---|---|
120 "value": "" | 120 "value": "" |
121 } | 121 } |
122 ] | 122 ] |
123 $ hg config --config auth.cookiefile= auth -T'json(defaultvalue)' | 123 $ hg config --config auth.cookiefile= auth -T'json(defaultvalue)' |
124 [ | 124 [ |
125 {"defaultvalue": ""} | 125 {"defaultvalue": null} |
126 ] | 126 ] |
127 $ hg config --config auth.cookiefile= auth -T'{defaultvalue}\n' | 127 $ hg config --config auth.cookiefile= auth -T'{defaultvalue}\n' |
128 | 128 |
129 | 129 |
130 false | 130 false |