diff --git a/mercurial/help/templates.txt b/mercurial/help/templates.txt --- a/mercurial/help/templates.txt +++ b/mercurial/help/templates.txt @@ -16,6 +16,9 @@ expansion:: $ hg log -r1 --template "{node}\n" b56ce7b07c52de7d5fd79fb89701ea538af65746 +Keywords +======== + Strings in curly braces are called keywords. The availability of keywords depends on the exact context of the templater. These keywords are usually available for templating a log-like command: @@ -32,6 +35,9 @@ You can also use a chain of filters to g $ hg tip --template "{date|isodate}\n" 2008-08-21 18:22 +0000 +Filters +======= + List of filters: .. filtersmarker @@ -39,10 +45,16 @@ List of filters: Note that a filter is nothing more than a function call, i.e. ``expr|filter`` is equivalent to ``filter(expr)``. +Functions +========= + In addition to filters, there are some basic built-in functions: .. functionsmarker +Infix +===== + We provide a limited set of infix arithmetic operations on integers:: + for addition @@ -60,6 +72,9 @@ As seen in the above example, ``{templat To prevent it from being interpreted, you can use an escape character ``\{`` or a raw string prefix, ``r'...'``. +Aliases +======= + New keywords and functions can be defined in the ``templatealias`` section of a Mercurial configuration file:: @@ -94,6 +109,9 @@ defines a template, ``nodedate``, which $ hg log -r . -Tnodedate +Examples +======== + Some sample command line templates: - Format lists, e.g. files::