[PATCH 4 of 4] templater: add 'convert_source' keyword

Mads Kiilerich mads at kiilerich.com
Thu Sep 2 09:49:02 CDT 2010


On 09/02/2010 03:44 PM, Dan Villiom Podlaski Christiansen wrote:
> # HG changeset patch
> # User Dan Villiom Podlaski Christiansen<danchr at gmail.com>
> # Date 1283434242 -7200
> # Node ID 5dea8cc1efcd6bf0272f7f956552c6306677426f
> # Parent  76b7a9941a452216062b5775e6c1cf066244c72f
> templater: add 'convert_source' keyword.
>
> diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
> --- a/mercurial/templatekw.py
> +++ b/mercurial/templatekw.py
> @@ -243,6 +243,10 @@ def showtransplantsource(**args):
>       src = args['ctx'].extra().get('transplant_source', None)
>       return showlist('transplant_source', src and [hex(src)] or [], **args)
>
> +def showconvertsource(**args):
> +    src = args['ctx'].extra().get('convert_revision', None)
> +    return showlist('convert_source', src and [src] or [], **args)

Extension-awareness in core isn't nice. You could argue that it's worth 
doing it anyway - that argumentation should probably be in the commit 
description.

But wouldn't it be better to introduce a "extra" template keyword with 
parameters? For example something like {extra/transplant_source|hex} ?

/Mads


More information about the Mercurial-devel mailing list