Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/hgweb_mod.py @ 27008:7f19f331ef59
hgweb: do not import templatefilters.revescape and websub as symbol
It will be enforced by the import checker.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 01 Nov 2015 14:00:14 +0900 |
parents | c8cbef073645 |
children | eac72c1e1e0d |
comparison
equal
deleted
inserted
replaced
27007:c8cbef073645 | 27008:7f19f331ef59 |
---|---|
8 | 8 |
9 import contextlib | 9 import contextlib |
10 import os | 10 import os |
11 from mercurial import hg, hook, error, encoding, templater, util, repoview | 11 from mercurial import hg, hook, error, encoding, templater, util, repoview |
12 from mercurial import ui as uimod | 12 from mercurial import ui as uimod |
13 from mercurial.templatefilters import websub | 13 from mercurial import templatefilters |
14 from common import ErrorResponse, permhooks, caching | 14 from common import ErrorResponse, permhooks, caching |
15 from common import HTTP_OK, HTTP_NOT_MODIFIED, HTTP_BAD_REQUEST | 15 from common import HTTP_OK, HTTP_NOT_MODIFIED, HTTP_BAD_REQUEST |
16 from common import HTTP_NOT_FOUND, HTTP_SERVER_ERROR | 16 from common import HTTP_NOT_FOUND, HTTP_SERVER_ERROR |
17 from request import wsgirequest | 17 from request import wsgirequest |
18 import webcommands, protocol, webutil | 18 import webcommands, protocol, webutil |
157 self.reponame = (self.config('web', 'name') | 157 self.reponame = (self.config('web', 'name') |
158 or req.env.get('REPO_NAME') | 158 or req.env.get('REPO_NAME') |
159 or req.url.strip('/') or self.repo.root) | 159 or req.url.strip('/') or self.repo.root) |
160 | 160 |
161 def websubfilter(text): | 161 def websubfilter(text): |
162 return websub(text, self.websubtable) | 162 return templatefilters.websub(text, self.websubtable) |
163 | 163 |
164 # create the templater | 164 # create the templater |
165 | 165 |
166 tmpl = templater.templater(mapfile, | 166 tmpl = templater.templater(mapfile, |
167 filters={'websub': websubfilter}, | 167 filters={'websub': websubfilter}, |