diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -153,8 +153,6 @@ def runsymbol(context, mapping, key): return v(**mapping) if isinstance(v, types.GeneratorType): v = list(v) - mapping[key] = v - return v return v def buildfilter(exp, context): diff --git a/tests/test-convert-hg-source.t b/tests/test-convert-hg-source.t --- a/tests/test-convert-hg-source.t +++ b/tests/test-convert-hg-source.t @@ -16,6 +16,12 @@ $ hg copy foo baz $ hg ci -m 'make bar and baz copies of foo' -d '2 0' created new head + +Test that template can print all file copies (issue4362) + $ hg log -r . --template "{file_copies % ' File: {file_copy}\n'}" + File: bar (foo) + File: baz (foo) + $ hg bookmark premerge1 $ hg merge -r 1 merging baz and foo to baz diff --git a/tests/test-graft.t b/tests/test-graft.t --- a/tests/test-graft.t +++ b/tests/test-graft.t @@ -478,6 +478,12 @@ The graft case date: Thu Jan 01 00:00:00 1970 +0000 summary: 2 +Test that template correctly expands more than one 'extra' (issue4362) + $ hg -R ../converted log -r 7 --template "{extras % ' Extra: {extra}\n'}" + Extra: branch=default + Extra: convert_revision=ef0ef43d49e79e81ddafdc7997401ba0041efc82 + Extra: source=e0213322b2c1a5d5d236c74e79666441bee67a7d + The transplant case $ hg -R ../converted log -r tip --template "{rev}: {node}\n{join(extras, '\n')}\n" 21: fbb6c5cc81002f2b4b49c9d731404688bcae5ade