equal
deleted
inserted
replaced
191 def gettemplater(ui, topic, spec): |
191 def gettemplater(ui, topic, spec): |
192 tmpl, mapfile = lookuptemplate(ui, topic, spec) |
192 tmpl, mapfile = lookuptemplate(ui, topic, spec) |
193 assert not (tmpl and mapfile) |
193 assert not (tmpl and mapfile) |
194 if mapfile: |
194 if mapfile: |
195 return templater.templater.frommapfile(mapfile) |
195 return templater.templater.frommapfile(mapfile) |
196 t = templater.templater() |
196 return maketemplater(ui, topic, tmpl) |
|
197 |
|
198 def maketemplater(ui, topic, tmpl, filters=None, cache=None): |
|
199 """Create a templater from a string template 'tmpl'""" |
|
200 t = templater.templater(filters=filters, cache=cache) |
197 if tmpl: |
201 if tmpl: |
198 t.cache[topic] = tmpl |
202 t.cache[topic] = tmpl |
199 return t |
203 return t |
200 |
204 |
201 def formatter(ui, topic, opts): |
205 def formatter(ui, topic, opts): |