Show More
@@ -10,6 +10,13 b' from mercurial.hgweb.hgweb_mod import hg' | |||||
10 | from mercurial.hgweb.request import wsgiapplication |
|
10 | from mercurial.hgweb.request import wsgiapplication | |
11 | import mercurial.hgweb.wsgicgi as wsgicgi |
|
11 | import mercurial.hgweb.wsgicgi as wsgicgi | |
12 |
|
12 | |||
|
13 | # If you'd like to serve pages with UTF-8 instead of your default | |||
|
14 | # locale charset, you can do so by uncommenting the following lines. | |||
|
15 | # Note that this will cause your .hgrc files to be interpreted in | |||
|
16 | # UTF-8 and all your repo files to be displayed using UTF-8. | |||
|
17 | # | |||
|
18 | # os.environ["HGENCODING"] = "UTF-8" | |||
|
19 | ||||
13 | def make_web_app(): |
|
20 | def make_web_app(): | |
14 | return hgweb("/path/to/repo", "repository name") |
|
21 | return hgweb("/path/to/repo", "repository name") | |
15 |
|
22 |
@@ -29,6 +29,13 b' import mercurial.hgweb.wsgicgi as wsgicg' | |||||
29 | # Alternatively you can pass a list of ('virtual/path', '/real/path') tuples |
|
29 | # Alternatively you can pass a list of ('virtual/path', '/real/path') tuples | |
30 | # or use a dictionary with entries like 'virtual/path': '/real/path' |
|
30 | # or use a dictionary with entries like 'virtual/path': '/real/path' | |
31 |
|
31 | |||
|
32 | # If you'd like to serve pages with UTF-8 instead of your default | |||
|
33 | # locale charset, you can do so by uncommenting the following lines. | |||
|
34 | # Note that this will cause your .hgrc files to be interpreted in | |||
|
35 | # UTF-8 and all your repo files to be displayed using UTF-8. | |||
|
36 | # | |||
|
37 | # os.environ["HGENCODING"] = "UTF-8" | |||
|
38 | ||||
32 | def make_web_app(): |
|
39 | def make_web_app(): | |
33 | return hgwebdir("hgweb.config") |
|
40 | return hgwebdir("hgweb.config") | |
34 |
|
41 |
@@ -654,7 +654,8 b' class hgweb(object):' | |||||
654 |
|
654 | |||
655 | def run_wsgi(self, req): |
|
655 | def run_wsgi(self, req): | |
656 | def header(**map): |
|
656 | def header(**map): | |
657 |
header_file = cStringIO.StringIO( |
|
657 | header_file = cStringIO.StringIO( | |
|
658 | ''.join(self.t("header", encoding = util._encoding, **map))) | |||
658 | msg = mimetools.Message(header_file, 0) |
|
659 | msg = mimetools.Message(header_file, 0) | |
659 | req.header(msg.items()) |
|
660 | req.header(msg.items()) | |
660 | yield header_file.read() |
|
661 | yield header_file.read() |
@@ -1,11 +1,10 b'' | |||||
1 | Content-type: text/html |
|
1 | Content-type: text/html; charset={encoding} | |
2 |
|
2 | |||
3 |
<?xml version="1.0" encoding=" |
|
3 | <?xml version="1.0" encoding="{encoding}"?> | |
4 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
|
4 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
5 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"> |
|
5 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"> | |
6 | <head> |
|
6 | <head> | |
7 | <link rel="icon" href="{url}static/hgicon.png" type="image/png"> |
|
7 | <link rel="icon" href="{url}static/hgicon.png" type="image/png"> | |
8 | <meta http-equiv="content-type" content="text/html; charset=utf-8"/> |
|
|||
9 | <meta name="robots" content="index, nofollow"/> |
|
8 | <meta name="robots" content="index, nofollow"/> | |
10 | <link rel="stylesheet" href="{url}static/style-gitweb.css" type="text/css" /> |
|
9 | <link rel="stylesheet" href="{url}static/style-gitweb.css" type="text/css" /> | |
11 |
|
10 |
General Comments 0
You need to be logged in to leave comments.
Login now