Mercurial > hg
comparison tests/test-template-engine @ 10056:1a114aca93fa
cmdutil: extract file changes closures into templatekw
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Sun, 13 Dec 2009 18:06:24 +0100 |
parents | e400a511e63a |
children | babc00a82c5e |
comparison
equal
deleted
inserted
replaced
10055:e400a511e63a | 10056:1a114aca93fa |
---|---|
9 self.loader = loader | 9 self.loader = loader |
10 | 10 |
11 def process(self, t, map): | 11 def process(self, t, map): |
12 tmpl = self.loader(t) | 12 tmpl = self.loader(t) |
13 for k, v in map.iteritems(): | 13 for k, v in map.iteritems(): |
14 if k in ('templ', 'ctx', 'repo'): | 14 if k in ('templ', 'ctx', 'repo', 'revcache'): |
15 continue | 15 continue |
16 if hasattr(v, '__call__'): | 16 if hasattr(v, '__call__'): |
17 v = v(**map) | 17 v = v(**map) |
18 v = templater.stringify(v) | 18 v = templater.stringify(v) |
19 tmpl = tmpl.replace('{{%s}}' % k, v) | 19 tmpl = tmpl.replace('{{%s}}' % k, v) |