mercurial/formatter.py
changeset 28955 78759f78a44e
parent 28954 f97a0bcfd7a1
child 28957 d813132ea361
equal deleted inserted replaced
28954:f97a0bcfd7a1 28955:78759f78a44e
   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):