Mercurial > public > mercurial-scm > hg
comparison mercurial/hgweb/hgweb_mod.py @ 7948:de377b1a9a84
move encoding bits from util to encoding
In addition to cleaning up util, this gets rid of some circular dependencies.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 03 Apr 2009 14:51:48 -0500 |
parents | 4a4c7f6a5912 |
children | aa983c3d94a9 |
comparison
equal
deleted
inserted
replaced
7947:a454eeb1b827 | 7948:de377b1a9a84 |
---|---|
5 # | 5 # |
6 # This software may be used and distributed according to the terms | 6 # This software may be used and distributed according to the terms |
7 # of the GNU General Public License, incorporated herein by reference. | 7 # of the GNU General Public License, incorporated herein by reference. |
8 | 8 |
9 import os | 9 import os |
10 from mercurial import ui, hg, util, hook, error | 10 from mercurial import ui, hg, util, hook, error, encoding |
11 from mercurial import templater, templatefilters | 11 from mercurial import templater, templatefilters |
12 from common import get_mtime, style_map, ErrorResponse | 12 from common import get_mtime, style_map, ErrorResponse |
13 from common import HTTP_OK, HTTP_BAD_REQUEST, HTTP_NOT_FOUND, HTTP_SERVER_ERROR | 13 from common import HTTP_OK, HTTP_BAD_REQUEST, HTTP_NOT_FOUND, HTTP_SERVER_ERROR |
14 from common import HTTP_UNAUTHORIZED, HTTP_METHOD_NOT_ALLOWED | 14 from common import HTTP_UNAUTHORIZED, HTTP_METHOD_NOT_ALLOWED |
15 from request import wsgirequest | 15 from request import wsgirequest |
63 self.maxchanges = int(self.config("web", "maxchanges", 10)) | 63 self.maxchanges = int(self.config("web", "maxchanges", 10)) |
64 self.stripecount = int(self.config("web", "stripes", 1)) | 64 self.stripecount = int(self.config("web", "stripes", 1)) |
65 self.maxshortchanges = int(self.config("web", "maxshortchanges", 60)) | 65 self.maxshortchanges = int(self.config("web", "maxshortchanges", 60)) |
66 self.maxfiles = int(self.config("web", "maxfiles", 10)) | 66 self.maxfiles = int(self.config("web", "maxfiles", 10)) |
67 self.allowpull = self.configbool("web", "allowpull", True) | 67 self.allowpull = self.configbool("web", "allowpull", True) |
68 self.encoding = self.config("web", "encoding", util._encoding) | 68 self.encoding = self.config("web", "encoding", encoding.encoding) |
69 | 69 |
70 def run(self): | 70 def run(self): |
71 if not os.environ.get('GATEWAY_INTERFACE', '').startswith("CGI/1."): | 71 if not os.environ.get('GATEWAY_INTERFACE', '').startswith("CGI/1."): |
72 raise RuntimeError("This function is only intended to be called while running as a CGI script.") | 72 raise RuntimeError("This function is only intended to be called while running as a CGI script.") |
73 import mercurial.hgweb.wsgicgi as wsgicgi | 73 import mercurial.hgweb.wsgicgi as wsgicgi |