mercurial/templatefilters.py
changeset 22668 13e3f07d74a3
parent 21873 cf599f8a2da8
child 23707 ae5447de4c11
--- a/mercurial/templatefilters.py	Sun Sep 28 17:35:33 2014 -0700
+++ b/mercurial/templatefilters.py	Tue Sep 09 22:14:13 2014 +0900
@@ -66,6 +66,10 @@
     """
     return os.path.basename(path)
 
+def count(i):
+    """:count: List or text. Returns the length as an integer."""
+    return len(i)
+
 def datefilter(text):
     """:date: Date. Returns a date in a Unix date format, including the
     timezone: "Mon Sep 04 15:13:13 2006 0700".
@@ -366,6 +370,7 @@
     "addbreaks": addbreaks,
     "age": age,
     "basename": basename,
+    "count": count,
     "date": datefilter,
     "domain": domain,
     "email": email,