templatefilters: don't stringify None into "None"
A few template keywords can in fact return None, such as {bisect}. In
some contexts, these get stringified into None instead of "". This is
leaking Python details into the UI.
--- a/mercurial/templatefilters.py Sun May 10 19:02:14 2015 +0800
+++ b/mercurial/templatefilters.py Sun May 10 13:33:51 2015 -0400
@@ -326,6 +326,8 @@
"""
if util.safehasattr(thing, '__iter__') and not isinstance(thing, str):
return "".join([stringify(t) for t in thing if t is not None])
+ if thing is None:
+ return ""
return str(thing)
def strip(text):