mercurial/templater.py
changeset 36989 de117f579431
parent 36988 317382151ac3
child 37014 a5311d7f4af8
equal deleted inserted replaced
36988:317382151ac3 36989:de117f579431
   723                 raise IOError(inst.args[0], encoding.strfromlocal(reason))
   723                 raise IOError(inst.args[0], encoding.strfromlocal(reason))
   724         return self.cache[t]
   724         return self.cache[t]
   725 
   725 
   726     def renderdefault(self, mapping):
   726     def renderdefault(self, mapping):
   727         """Render the default unnamed template and return result as string"""
   727         """Render the default unnamed template and return result as string"""
       
   728         return self.render('', mapping)
       
   729 
       
   730     def render(self, t, mapping):
       
   731         """Render the specified named template and return result as string"""
   728         mapping = pycompat.strkwargs(mapping)
   732         mapping = pycompat.strkwargs(mapping)
   729         return templateutil.stringify(self('', **mapping))
   733         return templateutil.stringify(self(t, **mapping))
   730 
   734 
   731     def __call__(self, t, **mapping):
   735     def __call__(self, t, **mapping):
   732         mapping = pycompat.byteskwargs(mapping)
   736         mapping = pycompat.byteskwargs(mapping)
   733         ttype = t in self.map and self.map[t][0] or 'default'
   737         ttype = t in self.map and self.map[t][0] or 'default'
   734         if ttype not in self.ecache:
   738         if ttype not in self.ecache: