mercurial/templatefilters.py
branchstable
changeset 35539 d1aae6d4efc5
parent 34837 4fdc4adbc838
child 35751 6d65cef5b038
equal deleted inserted replaced
35538:f39cf992216f 35539:d1aae6d4efc5
    88             return '%s ago' % fmt(t, n, a)
    88             return '%s ago' % fmt(t, n, a)
    89 
    89 
    90 @templatefilter('basename')
    90 @templatefilter('basename')
    91 def basename(path):
    91 def basename(path):
    92     """Any text. Treats the text as a path, and returns the last
    92     """Any text. Treats the text as a path, and returns the last
    93     component of the path after splitting by the path separator
    93     component of the path after splitting by the path separator.
    94     (ignoring trailing separators). For example, "foo/bar/baz" becomes
    94     For example, "foo/bar/baz" becomes "baz" and "foo/bar//" becomes "".
    95     "baz" and "foo/bar//" becomes "bar".
       
    96     """
    95     """
    97     return os.path.basename(path)
    96     return os.path.basename(path)
    98 
    97 
    99 @templatefilter('count')
    98 @templatefilter('count')
   100 def count(i):
    99 def count(i):