comparison mercurial/hgweb/hgweb_mod.py @ 27045:eac72c1e1e0d

hgweb: import wsgicgi at top level There should be no practical reason to delay the import of wsgicgi.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 01 Nov 2015 15:09:35 +0900
parents 7f19f331ef59
children 37fcfe52c68c
comparison
equal deleted inserted replaced
27044:1dde4914fb6c 27045:eac72c1e1e0d
13 from mercurial import templatefilters 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, wsgicgi
19 19
20 perms = { 20 perms = {
21 'changegroup': 'pull', 21 'changegroup': 'pull',
22 'changegroupsubset': 'pull', 22 'changegroupsubset': 'pull',
23 'getbundle': 'pull', 23 'getbundle': 'pull',
259 method, if possible. 259 method, if possible.
260 """ 260 """
261 if not os.environ.get('GATEWAY_INTERFACE', '').startswith("CGI/1."): 261 if not os.environ.get('GATEWAY_INTERFACE', '').startswith("CGI/1."):
262 raise RuntimeError("This function is only intended to be " 262 raise RuntimeError("This function is only intended to be "
263 "called while running as a CGI script.") 263 "called while running as a CGI script.")
264 import mercurial.hgweb.wsgicgi as wsgicgi
265 wsgicgi.launch(self) 264 wsgicgi.launch(self)
266 265
267 def __call__(self, env, respond): 266 def __call__(self, env, respond):
268 """Run the WSGI application. 267 """Run the WSGI application.
269 268