##// END OF EJS Templates
templatefilters: fix doc of basename()...
Yuya Nishihara -
r35577:d1aae6d4 stable
parent child Browse files
Show More
@@ -90,9 +90,8 b' def age(date, abbrev=False):'
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
@@ -2218,6 +2218,11 b' Age filter:'
2218 $ cd ..
2218 $ cd ..
2219 $ rm -rf unstable-hash
2219 $ rm -rf unstable-hash
2220
2220
2221 Filename filters:
2222
2223 $ hg debugtemplate '{"foo/bar"|basename}|{"foo/"|basename}|{"foo"|basename}|\n'
2224 bar||foo|
2225
2221 Add a dummy commit to make up for the instability of the above:
2226 Add a dummy commit to make up for the instability of the above:
2222
2227
2223 $ echo a > a
2228 $ echo a > a
General Comments 0
You need to be logged in to leave comments. Login now