Skip to content
Snippets Groups Projects
Commit a12d13eac513 authored by Mathias De Maré's avatar Mathias De Maré
Browse files

help: add example of '[templates]' usage

V2:
- move from shortest() with minlength 8 to minlength 4
- mention [templates] in config.txt
- better describe the difference between [templatealias] and [templates]

V3:
- choose a better example template
parent b8f9cdca8807
No related branches found
No related tags found
No related merge requests found
...@@ -1615,6 +1615,12 @@ ...@@ -1615,6 +1615,12 @@
Alias definitions for templates. See :hg:`help templates` for details. Alias definitions for templates. See :hg:`help templates` for details.
``templates``
-------------
Use the ``[templates]`` section to define template strings.
See :hg:`help templates` for details.
``trusted`` ``trusted``
----------- -----------
......
...@@ -71,6 +71,20 @@ ...@@ -71,6 +71,20 @@
defines two symbol aliases, ``r`` and ``rn``, and a function alias defines two symbol aliases, ``r`` and ``rn``, and a function alias
``leftpad()``. ``leftpad()``.
It's also possible to specify complete template strings, using the
``templates`` section. The syntax used is the general template string syntax.
For example,
::
[templates]
nodedate = "{node|short}: {date(date, "%Y-%m-%d")}\n"
defines a template, ``nodedate``, which can be called like::
$ hg log -r . -Tnodedate
Some sample command line templates: Some sample command line templates:
- Format lists, e.g. files:: - Format lists, e.g. files::
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment