diff --git a/mercurial/formatter.py b/mercurial/formatter.py --- a/mercurial/formatter.py +++ b/mercurial/formatter.py @@ -514,6 +514,8 @@ class templateresources(templater.resour mapping = {} if self._hasctx(newmapping): mapping['revcache'] = {} # per-ctx cache + if 'node' in origmapping and 'node' in newmapping: + mapping['originalnode'] = origmapping['node'] return mapping def _getsome(self, context, mapping, key): diff --git a/mercurial/templateutil.py b/mercurial/templateutil.py --- a/mercurial/templateutil.py +++ b/mercurial/templateutil.py @@ -406,7 +406,6 @@ def runmap(context, mapping, data): if isinstance(v, dict): lm = context.overlaymap(mapping, v) lm['index'] = i - lm['originalnode'] = mapping.get('node') yield evalrawexp(context, lm, targ) else: # v is not an iterable of dicts, this happen when 'key'