##// END OF EJS Templates
cmdutil: use '[committemplate]' section like as map file for style definition...
FUJIWARA Katsunori -
r22013:de5cee8b default
parent child Browse files
Show More
@@ -2228,6 +2228,10 b' def buildcommittemplate(repo, ctx, subs,'
2228 except SyntaxError, inst:
2228 except SyntaxError, inst:
2229 raise util.Abort(inst.args[0])
2229 raise util.Abort(inst.args[0])
2230
2230
2231 for k, v in repo.ui.configitems('committemplate'):
2232 if k != 'changeset':
2233 t.t.cache[k] = v
2234
2231 if not extramsg:
2235 if not extramsg:
2232 extramsg = '' # ensure that extramsg is string
2236 extramsg = '' # ensure that extramsg is string
2233
2237
@@ -419,6 +419,17 b' For example, ``changeset.tag.remove`` cu'
419 only for :hg:`tag --remove`, but ``changeset.tag`` customizes the
419 only for :hg:`tag --remove`, but ``changeset.tag`` customizes the
420 commit message for :hg:`tag` regardless of ``--remove`` option.
420 commit message for :hg:`tag` regardless of ``--remove`` option.
421
421
422 In this section, items other than ``changeset`` can be referred from
423 others. For example, the configuration to list committed files up
424 below can be referred as ``{listupfiles}``::
425
426 [committemplate]
427 listupfiles = {file_adds %
428 "HG: added {file}\n" }{file_mods %
429 "HG: changed {file}\n" }{file_dels %
430 "HG: removed {file}\n" }{if(files, "",
431 "HG: no files changed\n")}
432
422 ``decode/encode``
433 ``decode/encode``
423 -----------------
434 -----------------
424
435
@@ -32,17 +32,19 b" template keyword 'extramsg' work well)"
32
32
33 $ cat >> .hg/hgrc <<EOF
33 $ cat >> .hg/hgrc <<EOF
34 > [committemplate]
34 > [committemplate]
35 > listupfiles = {file_adds %
36 > "HG: added {file}\n" }{file_mods %
37 > "HG: changed {file}\n" }{file_dels %
38 > "HG: removed {file}\n" }{if(files, "",
39 > "HG: no files changed\n")}
40 >
35 > changeset = HG: this is customized commit template
41 > changeset = HG: this is customized commit template
36 > {desc}\n\n
42 > {desc}\n\n
37 > HG: Enter commit message. Lines beginning with 'HG:' are removed.
43 > HG: Enter commit message. Lines beginning with 'HG:' are removed.
38 > HG: {extramsg}
44 > HG: {extramsg}
39 > HG: --
45 > HG: --
40 > HG: user: {author}
46 > HG: user: {author}
41 > HG: branch '{branch}'\n{file_adds %
47 > HG: branch '{branch}'\n{listupfiles}
42 > "HG: added {file}\n" }{file_mods %
43 > "HG: changed {file}\n" }{file_dels %
44 > "HG: removed {file}\n" }{if(files, "",
45 > "HG: no files changed\n")}
46 > EOF
48 > EOF
47
49
48 $ echo bbbb > file
50 $ echo bbbb > file
General Comments 0
You need to be logged in to leave comments. Login now