# HG changeset patch # User Yuya Nishihara # Date 2017-09-30 07:50:24 # Node ID 1c7c4445686f9c487dd0021954e51aa31845a0c4 # Parent f30e59703d9819735a9335de73aa31691050ce2e templatekw: get rid of temporary dicts from shownamespaces() diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py --- a/mercurial/templatekw.py +++ b/mercurial/templatekw.py @@ -618,13 +618,9 @@ def shownamespaces(**args): repo = ctx.repo() namespaces = util.sortdict() - colornames = {} - builtins = {} for k, ns in repo.names.iteritems(): namespaces[k] = showlist('name', ns.names(repo, ctx.node()), args) - colornames[k] = ns.colorname - builtins[k] = ns.builtin f = _showlist('namespace', list(namespaces), args) @@ -632,8 +628,8 @@ def shownamespaces(**args): return { 'namespace': ns, 'names': namespaces[ns], - 'builtin': builtins[ns], - 'colorname': colornames[ns], + 'builtin': repo.names[ns].builtin, + 'colorname': repo.names[ns].colorname, } return _hybrid(f, namespaces, makemap, pycompat.identity)