Patchwork [3,of,4] hgweb: do not import templatefilters.revescape and websub as symbol

login
register
mail settings
Submitter Yuya Nishihara
Date Nov. 18, 2015, 3:44 p.m.
Message ID <638b99be51a0a3615274.1447861465@mimosa>
Download mbox | patch
Permalink /patch/11483/
State Accepted
Headers show

Comments

Yuya Nishihara - Nov. 18, 2015, 3:44 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1446354014 -32400
#      Sun Nov 01 14:00:14 2015 +0900
# Node ID 638b99be51a0a36152745893eddfb9e93e70980c
# Parent  1dcae8986f775c1fbaafea23156c46d97f66f44c
hgweb: do not import templatefilters.revescape and websub as symbol

It will be enforced by the import checker.

Patch

diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py
+++ b/mercurial/hgweb/hgweb_mod.py
@@ -10,7 +10,7 @@  import contextlib
 import os
 from mercurial import hg, hook, error, encoding, templater, util, repoview
 from mercurial import ui as uimod
-from mercurial.templatefilters import websub
+from mercurial import templatefilters
 from common import ErrorResponse, permhooks, caching
 from common import HTTP_OK, HTTP_NOT_MODIFIED, HTTP_BAD_REQUEST
 from common import HTTP_NOT_FOUND, HTTP_SERVER_ERROR
@@ -159,7 +159,7 @@  class requestcontext(object):
                              or req.url.strip('/') or self.repo.root)
 
         def websubfilter(text):
-            return websub(text, self.websubtable)
+            return templatefilters.websub(text, self.websubtable)
 
         # create the templater
 
diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webutil.py
+++ b/mercurial/hgweb/webutil.py
@@ -12,7 +12,7 @@  from mercurial import match, patch, erro
 from mercurial import ui as uimod
 from mercurial.i18n import _
 from mercurial.node import hex, nullid, short
-from mercurial.templatefilters import revescape
+from mercurial import templatefilters
 from common import ErrorResponse, paritygen
 from common import HTTP_NOT_FOUND
 import difflib
@@ -315,7 +315,7 @@  def changelistentry(web, ctx, tmpl):
 
 def symrevorshortnode(req, ctx):
     if 'node' in req.form:
-        return revescape(req.form['node'][0])
+        return templatefilters.revescape(req.form['node'][0])
     else:
         return short(ctx.node())