Submitter | Mathias De Maré |
---|---|
Date | Aug. 8, 2016, 5:41 p.m. |
Message ID | <e968eee739bd64116f16.1470678114@waste.org> |
Download | mbox | patch |
Permalink | /patch/16210/ |
State | Changes Requested |
Headers | show |
Comments
On Mon, 08 Aug 2016 12:41:54 -0500, Mathias De Maré wrote: > # HG changeset patch > # User Mathias De Maré <mathias.demare@gmail.com> > # Date 1470667662 -7200 > # Mon Aug 08 16:47:42 2016 +0200 > # Branch stable > # Node ID e968eee739bd64116f165f90d48671900b9add3c > # Parent b8f9cdca88077e97d4869320b9d18481fbe252ef > help: add example of '[templates]' usage > +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] > + short = "{shortest(node, 4)}" > + > +defines a template, ``short``, which can be called like:: > + > + $ hg log -r . -Tshort One more nit, this example seems not useful because it lacks '\n'. Can you add more plausible example something like short = "{node|short} {desc|firstline|strip}\n" ?
Patch
diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt --- a/mercurial/help/config.txt +++ b/mercurial/help/config.txt @@ -1615,6 +1615,12 @@ 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`` ----------- diff --git a/mercurial/help/templates.txt b/mercurial/help/templates.txt --- a/mercurial/help/templates.txt +++ b/mercurial/help/templates.txt @@ -71,6 +71,20 @@ defines two symbol aliases, ``r`` and ``rn``, and a function alias ``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] + short = "{shortest(node, 4)}" + +defines a template, ``short``, which can be called like:: + + $ hg log -r . -Tshort + Some sample command line templates: - Format lists, e.g. files::