##// END OF EJS Templates
formatter: always store a literal template unnamed...
Yuya Nishihara -
r32876:8da65da0 default
parent child Browse files
Show More
@@ -433,19 +433,16 b' def loadtemplater(ui, spec, cache=None):'
433 assert not (spec.tmpl and spec.mapfile)
433 assert not (spec.tmpl and spec.mapfile)
434 if spec.mapfile:
434 if spec.mapfile:
435 return templater.templater.frommapfile(spec.mapfile, cache=cache)
435 return templater.templater.frommapfile(spec.mapfile, cache=cache)
436 return _maketemplater(ui, spec.ref, spec.tmpl, cache=cache)
436 return maketemplater(ui, spec.tmpl, cache=cache)
437
437
438 def maketemplater(ui, tmpl, cache=None):
438 def maketemplater(ui, tmpl, cache=None):
439 """Create a templater from a string template 'tmpl'"""
439 """Create a templater from a string template 'tmpl'"""
440 return _maketemplater(ui, '', tmpl, cache=cache)
441
442 def _maketemplater(ui, topic, tmpl, cache=None):
443 aliases = ui.configitems('templatealias')
440 aliases = ui.configitems('templatealias')
444 t = templater.templater(cache=cache, aliases=aliases)
441 t = templater.templater(cache=cache, aliases=aliases)
445 t.cache.update((k, templater.unquotestring(v))
442 t.cache.update((k, templater.unquotestring(v))
446 for k, v in ui.configitems('templates'))
443 for k, v in ui.configitems('templates'))
447 if tmpl:
444 if tmpl:
448 t.cache[topic] = tmpl
445 t.cache[''] = tmpl
449 return t
446 return t
450
447
451 def formatter(ui, out, topic, opts):
448 def formatter(ui, out, topic, opts):
General Comments 0
You need to be logged in to leave comments. Login now