##// END OF EJS Templates
hgweb: support constructing URLs from an alternate base URL...
hgweb: support constructing URLs from an alternate base URL The web.baseurl config option allows server operators to define a custom URL for hosted content. The way it works today is that hgwebdir parses this config option into URL components then updates the appropriate WSGI environment variables so the request "lies" about its details. For example, SERVER_NAME is updated to reflect the alternate base URL's hostname. The WSGI environment should not be modified because WSGI applications may want to know the original request details (for debugging, etc). This commit teaches our request parser about the existence of an alternate base URL. If defined, the advertised URL and other self-reflected paths will take the alternate base URL into account. The hgweb WSGI application didn't use web.baseurl. But hgwebdir did. We update hgwebdir to alter the environment parsing accordingly. The old code around environment manipulation has been removed. With this change, parserequestfromenv() has grown to a bit unwieldy. Now that practically everyone is using it, it is obvious that there is some unused features that can be trimmed. So look for this in follow-up commits. Differential Revision: https://phab.mercurial-scm.org/D2822

File last commit:

r32940:75be1499 default
r36916:219b2335 default
Show More
test-gendoc.t
32 lines | 1.1 KiB | text/troff | Tads3Lexer
Matt Mackall
tests: replace exit 80 with #require
r22046 #require docutils
Eric Sumner
test-gendoc: require gettext...
r24043 #require gettext
Matt Mackall
tests: replace exit 80 with #require
r22046
Matt Mackall
tests: unify test-gendoc
r12427 Test document extraction
$ HGENCODING=UTF-8
$ export HGENCODING
Simon Heimberg
tests: use ls instead of find, all files are in the same directory...
r20390 $ { echo C; ls "$TESTDIR/../i18n"/*.po | sort; } | while read PO; do
Thomas Arendsen Hein
tests: make tests work if directory contains special characters...
r16350 > LOCALE=`basename "$PO" .po`
Matt Mackall
tests: unify test-gendoc
r12427 > echo "% extracting documentation from $LOCALE"
Augie Fackler
cleanup: use $PYTHON to run python in many more tests...
r32940 > LANGUAGE=$LOCALE $PYTHON "$TESTDIR/../doc/gendoc.py" >> gendoc-$LOCALE.txt 2> /dev/null || exit
Matt Mackall
tests: unify test-gendoc
r12427 >
Simon Heimberg
tests: test-gendoc.t checks if anything was translated...
r19923 > if [ $LOCALE != C ]; then
timeless
tests: splitting test-gendoc.t into per file tests...
r28809 > if [ ! -f $TESTDIR/test-gendoc-$LOCALE.t ]; then
> echo missing test-gendoc-$LOCALE.t
> fi
> cmp -s gendoc-C.txt gendoc-$LOCALE.txt && echo "** NOTHING TRANSLATED ($LOCALE) **"
Simon Heimberg
tests: test-gendoc.t checks if anything was translated...
r19923 > fi
timeless
tests: splitting test-gendoc.t into per file tests...
r28809 > done; true
Matt Mackall
tests: unify test-gendoc
r12427 % extracting documentation from C
% extracting documentation from da
% extracting documentation from de
% extracting documentation from el
% extracting documentation from fr
% extracting documentation from it
% extracting documentation from ja
% extracting documentation from pt_BR
% extracting documentation from ro
Martin Geisler
test-gendoc: update for new Russian translation
r14475 % extracting documentation from ru
Matt Mackall
tests: unify test-gendoc
r12427 % extracting documentation from sv
% extracting documentation from zh_CN
% extracting documentation from zh_TW