##// END OF EJS Templates
templates: introduce labelcset() function in map-cmdline.default as example
Yuya Nishihara -
r34717:d36a36ca default
parent child Browse files
Show More
@@ -1,84 +1,86 b''
1 # Base templates. Due to name clashes with existing keywords, we have
1 # Base templates. Due to name clashes with existing keywords, we have
2 # to replace some keywords with 'lkeyword', for 'labelled keyword'
2 # to replace some keywords with 'lkeyword', for 'labelled keyword'
3
3
4 [templates]
4 [templates]
5 changeset = '{cset}{branches}{bookmarks}{tags}{parents}{user}{ldate}{ltroubles}{summary}\n'
5 changeset = '{cset}{branches}{bookmarks}{tags}{parents}{user}{ldate}{ltroubles}{summary}\n'
6 changeset_quiet = '{lnode}'
6 changeset_quiet = '{lnode}'
7 changeset_verbose = '{cset}{branches}{bookmarks}{tags}{parents}{user}{ldate}{ltroubles}{lfiles}{lfile_copies_switch}{description}\n'
7 changeset_verbose = '{cset}{branches}{bookmarks}{tags}{parents}{user}{ldate}{ltroubles}{lfiles}{lfile_copies_switch}{description}\n'
8 changeset_debug = '{fullcset}{branches}{bookmarks}{tags}{lphase}{parents}{manifest}{user}{ldate}{ltroubles}{lfile_mods}{lfile_adds}{lfile_dels}{lfile_copies_switch}{extras}{description}\n'
8 changeset_debug = '{fullcset}{branches}{bookmarks}{tags}{lphase}{parents}{manifest}{user}{ldate}{ltroubles}{lfile_mods}{lfile_adds}{lfile_dels}{lfile_copies_switch}{extras}{description}\n'
9
9
10 # File templates
10 # File templates
11 lfiles = '{if(files,
11 lfiles = '{if(files,
12 label("ui.note log.files",
12 label("ui.note log.files",
13 "files: {files}\n"))}'
13 "files: {files}\n"))}'
14
14
15 lfile_mods = '{if(file_mods,
15 lfile_mods = '{if(file_mods,
16 label("ui.debug log.files",
16 label("ui.debug log.files",
17 "files: {file_mods}\n"))}'
17 "files: {file_mods}\n"))}'
18
18
19 lfile_adds = '{if(file_adds,
19 lfile_adds = '{if(file_adds,
20 label("ui.debug log.files",
20 label("ui.debug log.files",
21 "files+: {file_adds}\n"))}'
21 "files+: {file_adds}\n"))}'
22
22
23 lfile_dels = '{if(file_dels,
23 lfile_dels = '{if(file_dels,
24 label("ui.debug log.files",
24 label("ui.debug log.files",
25 "files-: {file_dels}\n"))}'
25 "files-: {file_dels}\n"))}'
26
26
27 lfile_copies_switch = '{if(file_copies_switch,
27 lfile_copies_switch = '{if(file_copies_switch,
28 label("ui.note log.copies",
28 label("ui.note log.copies",
29 "copies: {file_copies_switch
29 "copies: {file_copies_switch
30 % ' {name} ({source})'}\n"))}'
30 % ' {name} ({source})'}\n"))}'
31
31
32 # General templates
32 # General templates
33 _instability_label = 'instability.{instability}'
33 cset = '{labelcset("changeset: {rev}:{node|short}")}\n'
34 _troubles_labels = '{if(instabilities, "changeset.unstable {instabilities%_instability_label}")}'
34 fullcset = '{labelcset("changeset: {rev}:{node}")}\n'
35 _obsolete_label = '{if(obsolete, "changeset.obsolete")}'
36 _cset_labels = '{separate(" ", "log.changeset", "changeset.{phase}", "{_obsolete_label}", "{_troubles_labels}")}'
37 cset = '{label("{_cset_labels}",
38 "changeset: {rev}:{node|short}")}\n'
39
35
40 lphase = '{label("log.phase",
36 lphase = '{label("log.phase",
41 "phase: {phase}")}\n'
37 "phase: {phase}")}\n'
42
38
43 fullcset = '{label("{_cset_labels}",
44 "changeset: {rev}:{node}")}\n'
45
46 parent = '{label("log.parent changeset.{phase}",
39 parent = '{label("log.parent changeset.{phase}",
47 "parent: {rev}:{node|formatnode}")}\n'
40 "parent: {rev}:{node|formatnode}")}\n'
48
41
49 lnode = '{label("log.node",
42 lnode = '{label("log.node",
50 "{rev}:{node|short}")}\n'
43 "{rev}:{node|short}")}\n'
51
44
52 manifest = '{label("ui.debug log.manifest",
45 manifest = '{label("ui.debug log.manifest",
53 "manifest: {rev}:{node}")}\n'
46 "manifest: {rev}:{node}")}\n'
54
47
55 branch = '{label("log.branch",
48 branch = '{label("log.branch",
56 "branch: {branch}")}\n'
49 "branch: {branch}")}\n'
57
50
58 tag = '{label("log.tag",
51 tag = '{label("log.tag",
59 "tag: {tag}")}\n'
52 "tag: {tag}")}\n'
60
53
61 bookmark = '{label("log.bookmark",
54 bookmark = '{label("log.bookmark",
62 "bookmark: {bookmark}")}\n'
55 "bookmark: {bookmark}")}\n'
63
56
64 user = '{label("log.user",
57 user = '{label("log.user",
65 "user: {author}")}\n'
58 "user: {author}")}\n'
66
59
67 summary = '{if(desc|strip, "{label('log.summary',
60 summary = '{if(desc|strip, "{label('log.summary',
68 'summary: {desc|firstline}')}\n")}'
61 'summary: {desc|firstline}')}\n")}'
69
62
70 ldate = '{label("log.date",
63 ldate = '{label("log.date",
71 "date: {date|date}")}\n'
64 "date: {date|date}")}\n'
72
65
73 ltroubles = '{if(instabilities, "{label('log.instability',
66 ltroubles = '{if(instabilities, "{label('log.instability',
74 'instability: {join(instabilities, ", ")}')}\n")}'
67 'instability: {join(instabilities, ", ")}')}\n")}'
75
68
76 extra = '{label("ui.debug log.extra",
69 extra = '{label("ui.debug log.extra",
77 "extra: {key}={value|stringescape}")}\n'
70 "extra: {key}={value|stringescape}")}\n'
78
71
79 description = '{if(desc|strip, "{label('ui.note log.description',
72 description = '{if(desc|strip, "{label('ui.note log.description',
80 'description:')}
73 'description:')}
81 {label('ui.note log.description',
74 {label('ui.note log.description',
82 '{desc|strip}')}\n\n")}'
75 '{desc|strip}')}\n\n")}'
83
76
84 status = '{status} {path}\n{if(copy, " {copy}\n")}'
77 status = '{status} {path}\n{if(copy, " {copy}\n")}'
78
79 [templatealias]
80 labelcset(expr) = label(separate(" ",
81 "log.changeset",
82 "changeset.{phase}",
83 if(obsolete, "changeset.obsolete"),
84 if(instabilities, "changeset.unstable"),
85 instabilities % "instability.{instability}"),
86 expr)
General Comments 0
You need to be logged in to leave comments. Login now