Mercurial > public > mercurial-scm > hg
diff mercurial/help/config.txt @ 22013:de5cee8ba088
cmdutil: use '[committemplate]' section like as map file for style definition
Before this patch, each template definitions for 'changeset*' in
'[committemplate]' section have to be written fully from scratch,
even though many parts of them may be common.
This patch uses '[committemplate]' section like as the map file for
the style definition. All items other than 'changeset' can be referred
from others.
This can reduce total cost of template customization in
'[committemplate]' section.
When the commit template other than '[committemplate] changeset'
is chosen by 'editform', putting '[committemplate] changeset'
value into the cache of the templater causes unexpected result,
because the templater stores the specified (= chosen) template
definition into own cache as 'changeset' at construction time.
This is the reason why '[committemplate] changeset' can't be referred
from others.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sat, 02 Aug 2014 21:46:27 +0900 |
parents | 9d92b9d1e282 |
children | d7f25834ffbb |
line wrap: on
line diff
--- a/mercurial/help/config.txt Sat Aug 02 21:46:27 2014 +0900 +++ b/mercurial/help/config.txt Sat Aug 02 21:46:27 2014 +0900 @@ -419,6 +419,17 @@ only for :hg:`tag --remove`, but ``changeset.tag`` customizes the commit message for :hg:`tag` regardless of ``--remove`` option. +In this section, items other than ``changeset`` can be referred from +others. For example, the configuration to list committed files up +below can be referred as ``{listupfiles}``:: + + [committemplate] + listupfiles = {file_adds % + "HG: added {file}\n" }{file_mods % + "HG: changed {file}\n" }{file_dels % + "HG: removed {file}\n" }{if(files, "", + "HG: no files changed\n")} + ``decode/encode`` -----------------