Patchwork [2,of,5] help: apply the section headings from revsets to templates

login
register
mail settings
Submitter Matt Harbison
Date Jan. 8, 2017, 7:55 p.m.
Message ID <c83a2d1663303dff2255.1483905340@Envy>
Download mbox | patch
Permalink /patch/18138/
State Accepted
Headers show

Comments

Matt Harbison - Jan. 8, 2017, 7:55 p.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1483861381 18000
#      Sun Jan 08 02:43:01 2017 -0500
# Node ID c83a2d1663303dff22554a4d9f0f19770c9c3cc8
# Parent  ee55c68a5e4af49f0bbf5a131d62200550f16940
help: apply the section headings from revsets to templates

Unlike filesets, there are a few distinct headings that are not shared with
revsets.  But common names are used where possible.

Patch

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 @@ 
     $ 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 @@ 
    $ hg tip --template "{date|isodate}\n"
    2008-08-21 18:22 +0000
 
+Filters
+=======
+
 List of filters:
 
 .. filtersmarker
@@ -39,10 +45,16 @@ 
 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 @@ 
 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 @@ 
 
   $ hg log -r . -Tnodedate
 
+Examples
+========
+
 Some sample command line templates:
 
 - Format lists, e.g. files::