templatefilters: unroll handling of None/False/True
It doesn't make sense to use a dict here.
templatefilters: drop callable support from json()
This backs out
ae5447de4c11. A callable should be evaluated beforehand
by templater.runsymbol().
ui: use bytes IO and convert EOL manually in ui.editor()
Text IO sucks on Python 3 as it must be a unicode stream. We could introduce
a wrapper that converts unicode back to bytes, but it wouldn't be simple to
handle offsets transparently from/to underlying IOBase API.
Fortunately, we don't need to process huge text files, so let's stick to
bytes IO and convert EOL in memory.
util: add helper to convert between LF and native EOL
See the next patch for why.
util: extract pure tolf/tocrlf() functions from eol extension
This can be used for EOL conversion of text files.
pycompat: introduce identity function as a compat stub
I was sometimes too lazy to use 'str' instead of 'lambda a: a'. Let's add
a named function for that purpose.