Show More
@@ -90,9 +90,8 b' def age(date, abbrev=False):' | |||
|
90 | 90 | @templatefilter('basename') |
|
91 | 91 | def basename(path): |
|
92 | 92 | """Any text. Treats the text as a path, and returns the last |
|
93 | component of the path after splitting by the path separator | |
|
94 | (ignoring trailing separators). For example, "foo/bar/baz" becomes | |
|
95 | "baz" and "foo/bar//" becomes "bar". | |
|
93 | component of the path after splitting by the path separator. | |
|
94 | For example, "foo/bar/baz" becomes "baz" and "foo/bar//" becomes "". | |
|
96 | 95 | """ |
|
97 | 96 | return os.path.basename(path) |
|
98 | 97 |
@@ -2218,6 +2218,11 b' Age filter:' | |||
|
2218 | 2218 | $ cd .. |
|
2219 | 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 | 2226 | Add a dummy commit to make up for the instability of the above: |
|
2222 | 2227 | |
|
2223 | 2228 | $ echo a > a |
General Comments 0
You need to be logged in to leave comments.
Login now