Patchwork [2,of,3] help: Adding example 'extras' printing to 'hg help templates'

login
register
mail settings
Submitter Matthew Turk
Date Nov. 15, 2013, 10:52 p.m.
Message ID <b78c4813b053fd84eaf1.1384555976@ridcully>
Download mbox | patch
Permalink /patch/2953/
State Superseded
Commit f4b3bdc3019e8be6ba4791b297e0d6990fe0cb62
Headers show

Comments

Matthew Turk - Nov. 15, 2013, 10:52 p.m.
# HG changeset patch
# User Matthew Turk <matthewturk@gmail.com>
# Date 1384553642 18000
#      Fri Nov 15 17:14:02 2013 -0500
# Node ID b78c4813b053fd84eaf19b0df289d96d67e25b48
# Parent  0c27d52646b082ce934ab744ad5f3a28d4f9119a
help: Adding example 'extras' printing to 'hg help templates'
Sean Farley - Nov. 15, 2013, 11:05 p.m.
matthewturk@gmail.com writes:

> # HG changeset patch
> # User Matthew Turk <matthewturk@gmail.com>
> # Date 1384553642 18000
> #      Fri Nov 15 17:14:02 2013 -0500
> # Node ID b78c4813b053fd84eaf19b0df289d96d67e25b48
> # Parent  0c27d52646b082ce934ab744ad5f3a28d4f9119a
> help: Adding example 'extras' printing to 'hg help templates'

Bad shift key on the capitalized 'Adding' but otherwise looks good.

> diff -r 0c27d52646b0 -r b78c4813b053 mercurial/help/templates.txt
> --- a/mercurial/help/templates.txt	Fri Nov 15 16:53:54 2013 -0500
> +++ b/mercurial/help/templates.txt	Fri Nov 15 17:14:02 2013 -0500
> @@ -102,3 +102,7 @@
>  - Invert the firstline filter, i.e. everything but the first line::
>  
>     $ hg log -r 0 --template "{sub(r'^.*\n?\n?', '', desc)}\n"
> +
> +- Display the contents of the 'extra' field, one per line::
> +
> +  $ hg log -r 0 --template "{join(extras, '\n')}\n"
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff -r 0c27d52646b0 -r b78c4813b053 mercurial/help/templates.txt
--- a/mercurial/help/templates.txt	Fri Nov 15 16:53:54 2013 -0500
+++ b/mercurial/help/templates.txt	Fri Nov 15 17:14:02 2013 -0500
@@ -102,3 +102,7 @@ 
 - Invert the firstline filter, i.e. everything but the first line::
 
    $ hg log -r 0 --template "{sub(r'^.*\n?\n?', '', desc)}\n"
+
+- Display the contents of the 'extra' field, one per line::
+
+  $ hg log -r 0 --template "{join(extras, '\n')}\n"