# HG changeset patch # User Yuya Nishihara # Date 2018-04-02 12:54:12 # Node ID da8e9ecac4a4677de8e2d6c7bea082a2e236d56d # Parent 7c902a8345efd3bc079cd9579434ebba1df065e8 templater: deduplicate iterator of overlay mappings diff --git a/mercurial/templateutil.py b/mercurial/templateutil.py --- a/mercurial/templateutil.py +++ b/mercurial/templateutil.py @@ -599,9 +599,7 @@ def runmap(context, mapping, data): diter = d.itermaps(context) else: diter = _checkeditermaps(darg, d) - for i, v in enumerate(diter): - lm = context.overlaymap(mapping, v) - lm['index'] = i + for lm in _iteroverlaymaps(context, mapping, diter): yield evalrawexp(context, lm, targ) def runmember(context, mapping, data):