Mercurial > hg
comparison mercurial/templater.py @ 37084:f0b6fbea00cf
stringutil: bulk-replace call sites to point to new module
This might conflict with other patches floating around, sorry.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 22 Mar 2018 21:56:20 +0900 |
parents | 46859b437697 |
children | 638a241202a3 |
comparison
equal
deleted
inserted
replaced
37083:f99d64e8a4e4 | 37084:f0b6fbea00cf |
---|---|
60 pycompat, | 60 pycompat, |
61 templatefilters, | 61 templatefilters, |
62 templatefuncs, | 62 templatefuncs, |
63 templateutil, | 63 templateutil, |
64 util, | 64 util, |
65 ) | |
66 from .utils import ( | |
67 stringutil, | |
65 ) | 68 ) |
66 | 69 |
67 # template parsing | 70 # template parsing |
68 | 71 |
69 elements = { | 72 elements = { |
809 except KeyError as inst: | 812 except KeyError as inst: |
810 raise templateutil.TemplateNotFound( | 813 raise templateutil.TemplateNotFound( |
811 _('"%s" not in template map') % inst.args[0]) | 814 _('"%s" not in template map') % inst.args[0]) |
812 except IOError as inst: | 815 except IOError as inst: |
813 reason = (_('template file %s: %s') | 816 reason = (_('template file %s: %s') |
814 % (self.map[t][1], util.forcebytestr(inst.args[1]))) | 817 % (self.map[t][1], |
818 stringutil.forcebytestr(inst.args[1]))) | |
815 raise IOError(inst.args[0], encoding.strfromlocal(reason)) | 819 raise IOError(inst.args[0], encoding.strfromlocal(reason)) |
816 return self.cache[t] | 820 return self.cache[t] |
817 | 821 |
818 def renderdefault(self, mapping): | 822 def renderdefault(self, mapping): |
819 """Render the default unnamed template and return result as string""" | 823 """Render the default unnamed template and return result as string""" |