[PATCH 4 of 5] templater: use named function to named template against mapping dict (API)
Yuya Nishihara
yuya at tcha.org
Sun Mar 18 01:56:36 EDT 2018
On Sun, 18 Mar 2018 05:45:30 +0000, Martin von Zweigbergk wrote:
> On Sat, Mar 17, 2018 at 9:39 PM Yuya Nishihara <yuya at tcha.org> wrote:
>
> > diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py
> > --- a/mercurial/hgweb/webutil.py
> > +++ b/mercurial/hgweb/webutil.py
> > @@ -243,12 +243,18 @@ def nodebranchnodefault(ctx):
> > return branches
> >
> > def showtag(repo, tmpl, t1, node=nullid, **args):
> > + args = pycompat.byteskwargs(args)
> > for t in repo.nodetags(node):
> > - yield tmpl(t1, tag=t, **args)
> > + lm = args.copy()
> >
>
> Do we need to make a copy every time?
Most likely because tmpl(...) may return a thunk tied with the 'lm'.
It was copied by **args before.
More information about the Mercurial-devel
mailing list