hide some functions behind lambdas, so demandload is useful.
authorVadim Gelfer <vadim.gelfer@gmail.com>
Tue, 28 Feb 2006 07:24:54 -0800
changeset 1912 b288b4bb8448
parent 1911 c6014ff742c5
child 1913 74cf2b2f43d4
hide some functions behind lambdas, so demandload is useful.
mercurial/templater.py
--- 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):