Patchwork [2,of,3] help: modify template help to use a comma instead of newline for extras

login
register
mail settings
Submitter Matthew Turk
Date Nov. 21, 2013, 9:04 p.m.
Message ID <547837e59d439af3c907.1385067864@ridcully>
Download mbox | patch
Permalink /patch/3075/
State Superseded
Headers show

Comments

Matthew Turk - Nov. 21, 2013, 9:04 p.m.
# HG changeset patch
# User Matthew Turk <matthewturk@gmail.com>
# Date 1385066846 18000
#      Thu Nov 21 15:47:26 2013 -0500
# Node ID 547837e59d439af3c907931ca65cab911d00dfe3
# Parent  e4c89fff1cc57f532d43d0015445ab44a739f6d7
help: modify template help to use a comma instead of newline for extras.

Newlines need different escaping, and this is a more terse example of extras in
template help.
Augie Fackler - Dec. 14, 2013, 4:57 p.m.
On Thu, Nov 21, 2013 at 04:04:24PM -0500, Matthew Turk wrote:
> # HG changeset patch
> # User Matthew Turk <matthewturk@gmail.com>
> # Date 1385066846 18000
> #      Thu Nov 21 15:47:26 2013 -0500
> # Node ID 547837e59d439af3c907931ca65cab911d00dfe3
> # Parent  e4c89fff1cc57f532d43d0015445ab44a739f6d7
> help: modify template help to use a comma instead of newline for extras.
>
> Newlines need different escaping, and this is a more terse example of extras in
> template help.
>
> diff -r e4c89fff1cc5 -r 547837e59d43 mercurial/help/templates.txt
> --- a/mercurial/help/templates.txt	Thu Nov 21 15:46:49 2013 -0500
> +++ b/mercurial/help/templates.txt	Thu Nov 21 15:47:26 2013 -0500
> @@ -105,4 +105,4 @@
>
>  - Display the contents of the 'extra' field, one per line::

Is this output really still one per line?

>
> -  $ hg log -r 0 --template "{join(extras, '\n')}\n"
> +  $ hg log -r 0 --template "{join(extras, ', ')}\n"
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff -r e4c89fff1cc5 -r 547837e59d43 mercurial/help/templates.txt
--- a/mercurial/help/templates.txt	Thu Nov 21 15:46:49 2013 -0500
+++ b/mercurial/help/templates.txt	Thu Nov 21 15:47:26 2013 -0500
@@ -105,4 +105,4 @@ 
 
 - Display the contents of the 'extra' field, one per line::
 
-  $ hg log -r 0 --template "{join(extras, '\n')}\n"
+  $ hg log -r 0 --template "{join(extras, ', ')}\n"