Mercurial > hg
comparison mercurial/templater.py @ 17631:0b241d7a8c62
templating: make new-style templating features work with command line lists
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 21 Sep 2012 18:54:00 -0500 |
parents | 099c778ceb33 |
children | 523625e46760 |
comparison
equal
deleted
inserted
replaced
17630:ff5ed1ecd43a | 17631:0b241d7a8c62 |
---|---|
162 return (runmap, (func, data, ctmpl)) | 162 return (runmap, (func, data, ctmpl)) |
163 | 163 |
164 def runmap(context, mapping, data): | 164 def runmap(context, mapping, data): |
165 func, data, ctmpl = data | 165 func, data, ctmpl = data |
166 d = func(context, mapping, data) | 166 d = func(context, mapping, data) |
167 if util.safehasattr(d, '__call__'): | |
168 d = d() | |
169 | |
167 lm = mapping.copy() | 170 lm = mapping.copy() |
168 | 171 |
169 for i in d: | 172 for i in d: |
170 if isinstance(i, dict): | 173 if isinstance(i, dict): |
171 lm.update(i) | 174 lm.update(i) |