hgweb: use registrar to declare "websub" template filter
Prepares for adding 'intype' attribute.
--- a/mercurial/hgweb/hgweb_mod.py Sun Mar 25 12:15:33 2018 +0900
+++ b/mercurial/hgweb/hgweb_mod.py Mon Mar 19 20:39:06 2018 +0900
@@ -27,6 +27,7 @@
hook,
profiling,
pycompat,
+ registrar,
repoview,
templatefilters,
templater,
@@ -170,6 +171,9 @@
or req.apppath
or self.repo.root)
+ filters = {}
+ templatefilter = registrar.templatefilter(filters)
+ @templatefilter('websub')
def websubfilter(text):
return templatefilters.websub(text, self.websubtable)
@@ -191,7 +195,7 @@
}
tres = formatter.templateresources(self.repo.ui, self.repo)
tmpl = templater.templater.frommapfile(mapfile,
- filters={'websub': websubfilter},
+ filters=filters,
defaults=defaults,
resources=tres)
return tmpl