Mercurial > hg
diff tests/test-hgweb-commands.t @ 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 | d53212d70893 |
children | 0f0cda81e9b0 |
line wrap: on
line diff
--- a/tests/test-hgweb-commands.t Sun Sep 20 20:08:22 2015 +0900 +++ b/tests/test-hgweb-commands.t Sun Sep 20 20:11:31 2015 +0900 @@ -2050,6 +2050,35 @@ top: -1px; } +Stop and restart the server at the directory different from the repository +root. Even in such case, file patterns should be resolved relative to the +repository root. (issue4568) + + $ killdaemons.py + $ hg serve --config server.preferuncompressed=True -n test \ + > -p $HGPORT -d --pid-file=`pwd`/hg.pid -E `pwd`/errors.log \ + > --cwd .. -R `pwd` + $ cat hg.pid >> $DAEMON_PIDS + + $ get-with-headers.py 127.0.0.1:$HGPORT 'log?rev=adds("foo")&style=raw' + 200 Script output follows + + + # HG changesets search + # Node ID cad8025a2e87f88c06259790adfa15acb4080123 + # Query "adds("foo")" + # Mode revset expression search + + changeset: 2ef0ac749a14e4f57a5a822464a0902c6f7f448f + revision: 0 + user: test + date: Thu, 01 Jan 1970 00:00:00 +0000 + summary: base + tag: 1.0 + bookmark: anotherthing + + + Stop and restart with HGENCODING=cp932 and preferuncompressed $ killdaemons.py