hide some functions behind lambdas, so demandload is useful.
--- a/mercurial/templater.py Mon Feb 27 21:37:57 2006 -0800
+++ b/mercurial/templater.py Tue Feb 28 07:24:54 2006 -0800
@@ -213,16 +213,16 @@
"date": lambda x: util.datestr(x),
"domain": domain,
"escape": lambda x: cgi.escape(x, True),
- "firstline": (lambda x: x.splitlines(1)[0]),
+ "firstline": lambda x: x.splitlines(1)[0].rstrip('\r\n'),
"isodate": isodate,
"obfuscate": obfuscate,
- "permissions": (lambda x: x and "-rwxr-xr-x" or "-rw-r--r--"),
+ "permissions": lambda x: x and "-rwxr-xr-x" or "-rw-r--r--",
"person": person,
"rfc822date": lambda x: util.datestr(x, "%a, %d %b %Y %H:%M:%S"),
- "short": (lambda x: x[:12]),
+ "short": lambda x: x[:12],
"strip": lambda x: x.strip(),
- "urlescape": urllib.quote,
- "user": util.shortuser,
+ "urlescape": lambda x: urllib.quote(x),
+ "user": lambda x: util.shortuser(x),
}
def templatepath(name=None):