# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 2015-05-10 17:33:51 # Node ID c54248bbe023e2fbc3847dfc66d93044ede5072f # Parent 30f449378f643da08ba03b845b5a64a8ceea57da 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. diff --git a/mercurial/templatefilters.py b/mercurial/templatefilters.py --- a/mercurial/templatefilters.py +++ b/mercurial/templatefilters.py @@ -326,6 +326,8 @@ def stringify(thing): """ 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):