Mercurial > public > mercurial-scm > hg
comparison mercurial/templater.py @ 37159:b56b79185aad
templater: do not use stringify() to concatenate flattened template output
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 17 Mar 2018 20:13:06 +0900 |
parents | 888507ec655e |
children | 7d3bc1d4e871 |
comparison
equal
deleted
inserted
replaced
37158:e09d2183e226 | 37159:b56b79185aad |
---|---|
813 """Render the default unnamed template and return result as string""" | 813 """Render the default unnamed template and return result as string""" |
814 return self.render('', mapping) | 814 return self.render('', mapping) |
815 | 815 |
816 def render(self, t, mapping): | 816 def render(self, t, mapping): |
817 """Render the specified named template and return result as string""" | 817 """Render the specified named template and return result as string""" |
818 return templateutil.stringify(self.generate(t, mapping)) | 818 return b''.join(self.generate(t, mapping)) |
819 | 819 |
820 def generate(self, t, mapping): | 820 def generate(self, t, mapping): |
821 """Return a generator that renders the specified named template and | 821 """Return a generator that renders the specified named template and |
822 yields chunks""" | 822 yields chunks""" |
823 ttype = t in self.map and self.map[t][0] or 'default' | 823 ttype = t in self.map and self.map[t][0] or 'default' |