Show More
@@ -27,7 +27,7 b' import mercurial.hgweb.hgweb_mod' | |||
|
27 | 27 | import webob.exc |
|
28 | 28 | |
|
29 | 29 | from vcsserver import pygrack, exceptions, settings, git_lfs |
|
30 | from vcsserver.utils import ascii_bytes | |
|
30 | from vcsserver.utils import ascii_bytes, safe_bytes | |
|
31 | 31 | |
|
32 | 32 | log = logging.getLogger(__name__) |
|
33 | 33 | |
@@ -115,7 +115,10 b' def make_hg_ui_from_config(repo_config):' | |||
|
115 | 115 | baseui._tcfg = mercurial.config.config() |
|
116 | 116 | |
|
117 | 117 | for section, option, value in repo_config: |
|
118 | baseui.setconfig(ascii_bytes(section), ascii_bytes(option), ascii_bytes(value)) | |
|
118 | baseui.setconfig( | |
|
119 | ascii_bytes(section, allow_bytes=True), | |
|
120 | ascii_bytes(option, allow_bytes=True), | |
|
121 | ascii_bytes(value, allow_bytes=True)) | |
|
119 | 122 | |
|
120 | 123 | # make our hgweb quiet so it doesn't print output |
|
121 | 124 | baseui.setconfig(b'ui', b'quiet', b'true') |
@@ -131,11 +134,14 b' def update_hg_ui_from_hgrc(baseui, repo_' | |||
|
131 | 134 | return |
|
132 | 135 | log.debug('reading hgrc from %s', path) |
|
133 | 136 | cfg = mercurial.config.config() |
|
134 | cfg.read(path) | |
|
137 | cfg.read(ascii_bytes(path)) | |
|
135 | 138 | for section in HG_UI_SECTIONS: |
|
136 | 139 | for k, v in cfg.items(section): |
|
137 | 140 | log.debug('settings ui from file: [%s] %s=%s', section, k, v) |
|
138 | baseui.setconfig(ascii_bytes(section), ascii_bytes(k), ascii_bytes(v)) | |
|
141 | baseui.setconfig( | |
|
142 | ascii_bytes(section, allow_bytes=True), | |
|
143 | ascii_bytes(k, allow_bytes=True), | |
|
144 | ascii_bytes(v, allow_bytes=True)) | |
|
139 | 145 | |
|
140 | 146 | |
|
141 | 147 | def create_hg_wsgi_app(repo_path, repo_name, config): |
@@ -151,7 +157,7 b' def create_hg_wsgi_app(repo_path, repo_n' | |||
|
151 | 157 | update_hg_ui_from_hgrc(baseui, repo_path) |
|
152 | 158 | |
|
153 | 159 | try: |
|
154 | return HgWeb(repo_path, name=repo_name, baseui=baseui) | |
|
160 | return HgWeb(safe_bytes(repo_path), name=safe_bytes(repo_name), baseui=baseui) | |
|
155 | 161 | except mercurial.error.RequirementError as e: |
|
156 | 162 | raise exceptions.RequirementException(e)(e) |
|
157 | 163 |
General Comments 0
You need to be logged in to leave comments.
Login now