[PATCH 5 of 7] templatefilters: alias element of {_|splitlines} to {text}

Anton Shestakov av6 at dwimlabs.net
Mon Oct 1 07:28:51 UTC 2018


On Sun, 30 Sep 2018 22:43:49 +0900
Yuya Nishihara <yuya at tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1538289985 -32400
> #      Sun Sep 30 15:46:25 2018 +0900
> # Node ID 6b1a87ee8753534543236e3a64e66e8f0382b5eb
> # Parent  22f0acc9d2d80ae870d92636d9023b7849b616bb
> templatefilters: alias element of {_|splitlines} to {text}
> 
> We've renamed {line} of annotation result as such.
> 
> diff --git a/tests/test-template-functions.t b/tests/test-template-functions.t
> --- a/tests/test-template-functions.t
> +++ b/tests/test-template-functions.t
> @@ -1254,6 +1254,10 @@ Test splitlines
>    o  foo line 1
>       foo line 2
>  
> +  $ hg log -R a -r0 -T '{desc|splitlines % "{text}\n"}'
> +  line 1
> +  line 2
> +

I see it this way:

    # feels very natural
    lines = foo.splitlines()
    -or-
    for line in foo.splitlines()

    # looks weird
    texts = foo.splitlines()
    -or-
    for text in foo.splitlines()


More information about the Mercurial-devel mailing list