Show More
@@ -99,8 +99,8 b' def basename(path):' | |||||
99 | """ |
|
99 | """ | |
100 | return os.path.basename(path) |
|
100 | return os.path.basename(path) | |
101 |
|
101 | |||
102 |
@templatefilter('common |
|
102 | @templatefilter('commondir') | |
103 |
def common |
|
103 | def commondir(filelist): | |
104 | """List of text. Treats each list item as file name with / |
|
104 | """List of text. Treats each list item as file name with / | |
105 | as path separator and returns the longest common directory |
|
105 | as path separator and returns the longest common directory | |
106 | prefix shared by all list items. |
|
106 | prefix shared by all list items. |
@@ -1,23 +1,23 b'' | |||||
1 |
$ hg debugtemplate '{""|splitlines|common |
|
1 | $ hg debugtemplate '{""|splitlines|commondir}\n' | |
2 |
|
2 | |||
3 |
$ hg debugtemplate '{"foo/bar\nfoo/baz\nfoo/foobar\n"|splitlines|common |
|
3 | $ hg debugtemplate '{"foo/bar\nfoo/baz\nfoo/foobar\n"|splitlines|commondir}\n' | |
4 | foo |
|
4 | foo | |
5 |
$ hg debugtemplate '{"foo/bar\nfoo/bar\n"|splitlines|common |
|
5 | $ hg debugtemplate '{"foo/bar\nfoo/bar\n"|splitlines|commondir}\n' | |
6 | foo |
|
6 | foo | |
7 |
$ hg debugtemplate '{"/foo/bar\n/foo/bar\n"|splitlines|common |
|
7 | $ hg debugtemplate '{"/foo/bar\n/foo/bar\n"|splitlines|commondir}\n' | |
8 | foo |
|
8 | foo | |
9 |
$ hg debugtemplate '{"/foo\n/foo\n"|splitlines|common |
|
9 | $ hg debugtemplate '{"/foo\n/foo\n"|splitlines|commondir}\n' | |
10 |
|
10 | |||
11 |
$ hg debugtemplate '{"foo/bar\nbar/baz"|splitlines|common |
|
11 | $ hg debugtemplate '{"foo/bar\nbar/baz"|splitlines|commondir}\n' | |
12 |
|
12 | |||
13 |
$ hg debugtemplate '{"foo/bar\nbar/baz\nbar/foo\n"|splitlines|common |
|
13 | $ hg debugtemplate '{"foo/bar\nbar/baz\nbar/foo\n"|splitlines|commondir}\n' | |
14 |
|
14 | |||
15 |
$ hg debugtemplate '{"foo/../bar\nfoo/bar"|splitlines|common |
|
15 | $ hg debugtemplate '{"foo/../bar\nfoo/bar"|splitlines|commondir}\n' | |
16 | foo |
|
16 | foo | |
17 |
$ hg debugtemplate '{"foo\n/foo"|splitlines|common |
|
17 | $ hg debugtemplate '{"foo\n/foo"|splitlines|commondir}\n' | |
18 |
|
18 | |||
19 | $ hg init |
|
19 | $ hg init | |
20 |
$ hg log -r null -T '{rev|common |
|
20 | $ hg log -r null -T '{rev|commondir}' | |
21 | hg: parse error: argument is not a list of text |
|
21 | hg: parse error: argument is not a list of text | |
22 |
(template filter 'common |
|
22 | (template filter 'commondir' is not compatible with keyword 'rev') | |
23 | [255] |
|
23 | [255] |
General Comments 0
You need to be logged in to leave comments.
Login now