comparison mercurial/hgweb/hgweb_mod.py @ 37225:08e042f0a67c

templatefilters: declare input type as bytes where appropriate Some test outputs changed since input is now coerced to a byte string. I think that's okay. Maybe {date} should have some readable representation?
author Yuya Nishihara <yuya@tcha.org>
date Sun, 18 Mar 2018 15:42:28 +0900
parents 307ee8883975
children cb7b275c0cd0
comparison
equal deleted inserted replaced
37224:54355c243042 37225:08e042f0a67c
171 or req.apppath 171 or req.apppath
172 or self.repo.root) 172 or self.repo.root)
173 173
174 filters = {} 174 filters = {}
175 templatefilter = registrar.templatefilter(filters) 175 templatefilter = registrar.templatefilter(filters)
176 @templatefilter('websub') 176 @templatefilter('websub', intype=bytes)
177 def websubfilter(text): 177 def websubfilter(text):
178 return templatefilters.websub(text, self.websubtable) 178 return templatefilters.websub(text, self.websubtable)
179 179
180 # create the templater 180 # create the templater
181 # TODO: export all keywords: defaults = templatekw.keywords.copy() 181 # TODO: export all keywords: defaults = templatekw.keywords.copy()