Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/hgweb_mod.py @ 4690:ecea4de3104e
Enable to select encoding in hgrc web section
This patch provides character encoding setting in each repository. After this
patch, You can use multi encoding repositories with one mercurial server.
author | OHASHI Hideya <ohachige at gmail.com> |
---|---|
date | Wed, 13 Jun 2007 18:18:06 +0900 |
parents | 96e096fe9e86 |
children | e21a0e12ff10 |
comparison
equal
deleted
inserted
replaced
4689:54a2b94a372c | 4690:ecea4de3104e |
---|---|
101 self.maxchanges = int(self.config("web", "maxchanges", 10)) | 101 self.maxchanges = int(self.config("web", "maxchanges", 10)) |
102 self.stripecount = int(self.config("web", "stripes", 1)) | 102 self.stripecount = int(self.config("web", "stripes", 1)) |
103 self.maxshortchanges = int(self.config("web", "maxshortchanges", 60)) | 103 self.maxshortchanges = int(self.config("web", "maxshortchanges", 60)) |
104 self.maxfiles = int(self.config("web", "maxfiles", 10)) | 104 self.maxfiles = int(self.config("web", "maxfiles", 10)) |
105 self.allowpull = self.configbool("web", "allowpull", True) | 105 self.allowpull = self.configbool("web", "allowpull", True) |
106 self.encoding = self.config("web", "encoding", util._encoding) | |
106 | 107 |
107 def archivelist(self, nodeid): | 108 def archivelist(self, nodeid): |
108 allowed = self.configlist("web", "allow_archive") | 109 allowed = self.configlist("web", "allow_archive") |
109 for i, spec in self.archive_specs.iteritems(): | 110 for i, spec in self.archive_specs.iteritems(): |
110 if i in allowed or self.configbool("web", "allow" + i): | 111 if i in allowed or self.configbool("web", "allow" + i): |
653 wsgicgi.launch(wsgiapplication(make_web_app)) | 654 wsgicgi.launch(wsgiapplication(make_web_app)) |
654 | 655 |
655 def run_wsgi(self, req): | 656 def run_wsgi(self, req): |
656 def header(**map): | 657 def header(**map): |
657 header_file = cStringIO.StringIO( | 658 header_file = cStringIO.StringIO( |
658 ''.join(self.t("header", encoding=util._encoding, **map))) | 659 ''.join(self.t("header", encoding=self.encoding, **map))) |
659 msg = mimetools.Message(header_file, 0) | 660 msg = mimetools.Message(header_file, 0) |
660 req.header(msg.items()) | 661 req.header(msg.items()) |
661 yield header_file.read() | 662 yield header_file.read() |
662 | 663 |
663 def rawfileheader(**map): | 664 def rawfileheader(**map): |