[PATCH 8 of 8] templater: wrap get/min/max result so map operation can apply

Yuya Nishihara yuya at tcha.org
Sun Sep 24 08:36:37 EDT 2017


On Sun, 24 Sep 2017 21:21:57 +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1504952005 -32400
> #      Sat Sep 09 19:13:25 2017 +0900
> # Node ID ae5017a7b3753295d946a13421eecf65e675f3c1
> # Parent  a0047461f18c7d3d341bcecda6975bb58b53651b
> templater: wrap get/min/max result so map operation can apply

Please disregard this, the last patch.

> --- a/mercurial/templater.py
> +++ b/mercurial/templater.py
> @@ -713,7 +713,10 @@ def get(context, mapping, args):
>          raise error.ParseError(_("get() expects a dict as first argument"))
>  
>      key = evalfuncarg(context, mapping, args[1])
> -    return dictarg.get(key)
> +    val = dictarg.get(key)
> +    if val is None:
> +        return
> +    return templatekw.wraphybridvalue(dictarg, key, dictarg.get(key))

s/dictarg.get(key)/val/

I'll include the fixed version in the next series.


More information about the Mercurial-devel mailing list