comparison tests/test-hgwebdir @ 10674:6d87c20cd7a8 stable

hgweb: fix broken URLs of RSS/Atom feeds (issue1772) This fixes doubled URL, e.g. http://example.orghttp://example.org/..., which appears on RSS/Atom feeds served by hgwebdir. It splits baseurl to update SERVER_NAME, SERVER_PORT and SCRIPT_NAME, according to RFC 3875. Updated the test output since SCRIPT_NAME becomes not to contain http://host:port part.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 11 Mar 2010 00:28:27 +0900
parents 8635b33eaade
children c63a6ddbbf9a
comparison
equal deleted inserted replaced
10673:9848b39a1472 10674:6d87c20cd7a8
49 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/b/file/tip/b?style=raw' 49 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/b/file/tip/b?style=raw'
50 50
51 echo % should give a 404 - repo is not published 51 echo % should give a 404 - repo is not published
52 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/c/file/tip/c?style=raw' 52 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/c/file/tip/c?style=raw'
53 53
54 echo % atom-log without basedir
55 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/atom-log' \
56 | grep '<link' | sed 's|//[.a-zA-Z0-9\-_]*:[0-9][0-9]*/|//example.com:8080/|'
57
58 echo % rss-log without basedir
59 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/a/rss-log' \
60 | grep '<guid' | sed 's|//[.a-zA-Z0-9\-_]*:[0-9][0-9]*/|//example.com:8080/|'
54 61
55 cat > paths.conf <<EOF 62 cat > paths.conf <<EOF
56 [paths] 63 [paths]
57 t/a/=$root/a 64 t/a/=$root/a
58 b=$root/b 65 b=$root/b
117 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/?style=raw' 124 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/?style=raw'
118 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/file/tip/a?style=raw' 125 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/file/tip/a?style=raw'
119 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/b/file/tip/b?style=raw' 126 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/b/file/tip/b?style=raw'
120 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/c/file/tip/c?style=raw' 127 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/c/file/tip/c?style=raw'
121 128
129 echo % atom-log with basedir /
130 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/atom-log' \
131 | grep '<link' | sed 's|//[.a-zA-Z0-9\-_]*:[0-9][0-9]*/|//example.com:8080/|'
132
133 echo % rss-log with basedir /
134 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/rss-log' \
135 | grep '<guid' | sed 's|//[.a-zA-Z0-9\-_]*:[0-9][0-9]*/|//example.com:8080/|'
136
137 "$TESTDIR/killdaemons.py"
138
139 hg serve --config web.baseurl=http://hg.example.com:8080/foo/ -p $HGPORT2 -d \
140 --pid-file=hg.pid --webdir-conf collections.conf \
141 -A access-collections-2.log -E error-collections-2.log
142 cat hg.pid >> $DAEMON_PIDS
143
144 echo % atom-log with basedir /foo/
145 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/atom-log' \
146 | grep '<link' | sed 's|//[.a-zA-Z0-9\-_]*:[0-9][0-9]*/|//example.com:8080/|'
147
148 echo % rss-log with basedir /foo/
149 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/a/rss-log' \
150 | grep '<guid' | sed 's|//[.a-zA-Z0-9\-_]*:[0-9][0-9]*/|//example.com:8080/|'
122 151
123 echo % paths errors 1 152 echo % paths errors 1
124 cat error-paths-1.log 153 cat error-paths-1.log
125 echo % paths errors 2 154 echo % paths errors 2
126 cat error-paths-2.log 155 cat error-paths-2.log
127 echo % paths errors 3 156 echo % paths errors 3
128 cat error-paths-3.log 157 cat error-paths-3.log
129 echo % collections errors 158 echo % collections errors
130 cat error-collections.log 159 cat error-collections.log
160 echo % collections errors 2
161 cat error-collections-2.log