merge with stable
authorMatt Mackall <mpm@selenic.com>
Tue, 04 Nov 2014 16:43:33 -0600
changeset 23176 329c6b4414ae
parent 23175 5ec7b2cb577b (current diff)
parent 23167 a3c2d9211294 (diff)
child 23177 706547a14b8b
merge with stable
--- a/mercurial/templater.py	Tue Nov 04 21:54:27 2014 +0100
+++ b/mercurial/templater.py	Tue Nov 04 16:43:33 2014 -0600
@@ -153,8 +153,6 @@
         return v(**mapping)
     if isinstance(v, types.GeneratorType):
         v = list(v)
-        mapping[key] = v
-        return v
     return v
 
 def buildfilter(exp, context):
--- a/tests/test-convert-hg-source.t	Tue Nov 04 21:54:27 2014 +0100
+++ b/tests/test-convert-hg-source.t	Tue Nov 04 16:43:33 2014 -0600
@@ -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
--- a/tests/test-graft.t	Tue Nov 04 21:54:27 2014 +0100
+++ b/tests/test-graft.t	Tue Nov 04 16:43:33 2014 -0600
@@ -478,6 +478,12 @@
   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