comparison mercurial/hgweb/hgweb_mod.py @ 26294:1ffc61c4e32e

hgweb: overwrite cwd to resolve file patterns relative to repo (issue4568) It's useless to handle file patterns as relative to the cwd of the server process. The only sensible way in hgweb is to resolve paths relative to the repository root. It seems dirstate.getcwd() isn't used to get a real file path, so this patch won't cause problem.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 20 Sep 2015 20:11:31 +0900
parents 7df5d4760873
children 4b0fc75f9403
comparison
equal deleted inserted replaced
26293:3d24f31c6b8f 26294:1ffc61c4e32e
203 203
204 r.ui.setconfig('ui', 'report_untrusted', 'off', 'hgweb') 204 r.ui.setconfig('ui', 'report_untrusted', 'off', 'hgweb')
205 r.baseui.setconfig('ui', 'report_untrusted', 'off', 'hgweb') 205 r.baseui.setconfig('ui', 'report_untrusted', 'off', 'hgweb')
206 r.ui.setconfig('ui', 'nontty', 'true', 'hgweb') 206 r.ui.setconfig('ui', 'nontty', 'true', 'hgweb')
207 r.baseui.setconfig('ui', 'nontty', 'true', 'hgweb') 207 r.baseui.setconfig('ui', 'nontty', 'true', 'hgweb')
208 # resolve file patterns relative to repo root
209 r.ui.setconfig('ui', 'forcecwd', r.root, 'hgweb')
210 r.baseui.setconfig('ui', 'forcecwd', r.root, 'hgweb')
208 # displaying bundling progress bar while serving feel wrong and may 211 # displaying bundling progress bar while serving feel wrong and may
209 # break some wsgi implementation. 212 # break some wsgi implementation.
210 r.ui.setconfig('progress', 'disable', 'true', 'hgweb') 213 r.ui.setconfig('progress', 'disable', 'true', 'hgweb')
211 r.baseui.setconfig('progress', 'disable', 'true', 'hgweb') 214 r.baseui.setconfig('progress', 'disable', 'true', 'hgweb')
212 self._repos = [hg.cachedlocalrepo(self._webifyrepo(r))] 215 self._repos = [hg.cachedlocalrepo(self._webifyrepo(r))]