annotate tests/test-webraw @ 9857:24bc6e414610

diff: change --inverse to --reverse This fixes an incompatibility with patch(1), which also uses --reverse for reversed diffs. The --inverse flag was added in 3f522d2fa633. That name was chosen over --reverse since it was thought that --reverse would make --rev ambiguous. It turns out that both flags can co-exist, with the cost that --rev can no longer be shortened to --r and --re. Since one can always use the short -r option, this is not a real problem.
author Martin Geisler <mg@lazybytes.net>
date Sat, 14 Nov 2009 14:21:53 +0100
parents 1c0e7afe824a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2532
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
1 #!/bin/sh
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
2
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
3 hg init test
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
4 cd test
6136
acfb9fa494e2 hgweb: Pass only filename instead of full path when downloading raw files.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5384
diff changeset
5 mkdir sub
6137
1c0e7afe824a hgweb: Quote filenames when downloading raw files.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6136
diff changeset
6 cat >'sub/some "text".txt' <<ENDSOME
2532
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
7 This is just some random text
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
8 that will go inside the file and take a few lines.
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
9 It is very boring to read, but computers don't
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
10 care about things like that.
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
11 ENDSOME
6137
1c0e7afe824a hgweb: Quote filenames when downloading raw files.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6136
diff changeset
12 hg add 'sub/some "text".txt'
2536
8106e477f584 Fix new tests to be better. In particular, fix webraw test to
Eric Hopper <hopper@omnifarious.org>
parents: 2532
diff changeset
13 hg commit -d "1 0" -m "Just some text"
5384
e3a0c092b4e2 Allow tests to run in parallel.
Bryan O'Sullivan <bos@serpentine.com>
parents: 2571
diff changeset
14 hg serve -p $HGPORT -A access.log -E error.log -d --pid-file=hg.pid
2571
83cfd95eafb5 tests: add timeouts, make run-tests.py clean up dead daemon processes
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2547
diff changeset
15 cat hg.pid >> $DAEMON_PIDS
6137
1c0e7afe824a hgweb: Quote filenames when downloading raw files.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6136
diff changeset
16 ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw' content-type content-length content-disposition) >getoutput.txt &
2532
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
17
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
18 sleep 5
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
19 kill `cat hg.pid`
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
20 sleep 1 # wait for server to scream and die
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
21 cat getoutput.txt
2547
d75c68b55af8 test-webraw: do not store hostname in test output
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2536
diff changeset
22 cat access.log error.log | \
d75c68b55af8 test-webraw: do not store hostname in test output
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2536
diff changeset
23 sed 's/^[^ ]*\( [^[]*\[\)[^]]*\(\].*\)$/host\1date\2/'