comparison mercurial/help/templates.txt @ 25004:e264d4c9629b

help: rewrite template examples to use integer literals where appropriate
author Yuya Nishihara <yuya@tcha.org>
date Sat, 02 May 2015 15:51:57 +0900
parents 76c0b4cfa039
children f26efa4f0eff
comparison
equal deleted inserted replaced
25003:5e584edbb211 25004:e264d4c9629b
65 65
66 $ hg log -r 0 --template "{date(date, '%Y')}\n" 66 $ hg log -r 0 --template "{date(date, '%Y')}\n"
67 67
68 - Output the description set to a fill-width of 30:: 68 - Output the description set to a fill-width of 30::
69 69
70 $ hg log -r 0 --template "{fill(desc, '30')}" 70 $ hg log -r 0 --template "{fill(desc, 30)}"
71 71
72 - Use a conditional to test for the default branch:: 72 - Use a conditional to test for the default branch::
73 73
74 $ hg log -r 0 --template "{ifeq(branch, 'default', 'on the main branch', 74 $ hg log -r 0 --template "{ifeq(branch, 'default', 'on the main branch',
75 'on branch {branch}')}\n" 75 'on branch {branch}')}\n"
102 102
103 $ hg log --template "{startswith(\"template\", firstline(desc))}\n" 103 $ hg log --template "{startswith(\"template\", firstline(desc))}\n"
104 104
105 - Print the first word of each line of a commit message:: 105 - Print the first word of each line of a commit message::
106 106
107 $ hg log --template "{word(\"0\", desc)}\n" 107 $ hg log --template "{word(0, desc)}\n"