diff -r 07ddec2ea203 -r acc202b71619 mercurial/templatefilters.py --- a/mercurial/templatefilters.py Tue May 12 10:57:55 2009 +0200 +++ b/mercurial/templatefilters.py Tue May 12 12:04:05 2009 +0200 @@ -8,6 +8,12 @@ import cgi, re, os, time, urllib, textwrap import util, templater, encoding +def stringify(thing): + '''turn nested template iterator into string.''' + if hasattr(thing, '__iter__') and not isinstance(thing, str): + return "".join([stringify(t) for t in thing if t is not None]) + return str(thing) + agescales = [("second", 1), ("minute", 60), ("hour", 3600), @@ -194,7 +200,7 @@ "rfc3339date": lambda x: util.datestr(x, "%Y-%m-%dT%H:%M:%S%1:%2"), "short": lambda x: x[:12], "shortdate": util.shortdate, - "stringify": templater.stringify, + "stringify": stringify, "strip": lambda x: x.strip(), "urlescape": lambda x: urllib.quote(x), "user": lambda x: util.shortuser(x),