Mercurial > public > mercurial-scm > hg-stable
diff mercurial/filemerge.py @ 35487:817a3d20dd01
templater: register keywords to defaults table
Since the keywords are permanent, there should be no need to pass them
by a temporary mapping.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Fri, 22 Dec 2017 21:19:29 +0900 |
parents | c240657febb7 |
children | c0439e11af16 |
line wrap: on
line diff
--- a/mercurial/filemerge.py Fri Dec 22 21:22:49 2017 +0900 +++ b/mercurial/filemerge.py Fri Dec 22 21:19:29 2017 +0900 @@ -552,8 +552,7 @@ if ctx.node() is None: ctx = ctx.p1() - props = templatekw.keywords.copy() - props['ctx'] = ctx + props = {'ctx': ctx} templateresult = template.render(props) label = ('%s:' % label).ljust(pad + 1) @@ -580,7 +579,8 @@ template = ui.config('ui', 'mergemarkertemplate') template = templater.unquotestring(template) tres = formatter.templateresources(ui, repo) - tmpl = formatter.maketemplater(ui, template, resources=tres) + tmpl = formatter.maketemplater(ui, template, defaults=templatekw.keywords, + resources=tres) pad = max(len(l) for l in labels)