Show More
@@ -1,90 +1,89 | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | "$TESTDIR/hghave" pygments || exit 80 |
|
3 | "$TESTDIR/hghave" pygments || exit 80 | |
4 |
|
4 | |||
5 | cat <<EOF >> $HGRCPATH |
|
5 | cat <<EOF >> $HGRCPATH | |
6 | [extensions] |
|
6 | [extensions] | |
7 | hgext.highlight = |
|
7 | hgext.highlight = | |
8 | [web] |
|
8 | [web] | |
9 | pygments_style = friendly |
|
9 | pygments_style = friendly | |
10 | EOF |
|
10 | EOF | |
11 |
|
11 | |||
12 | hg init test |
|
12 | hg init test | |
13 | cd test |
|
13 | cd test | |
14 | cp $TESTDIR/get-with-headers.py ./ |
|
14 | cp $TESTDIR/get-with-headers.py ./ | |
15 |
|
15 | |||
16 | # check for UnicodeDecodeError with iso-8859-1 file contents |
|
16 | # check for UnicodeDecodeError with iso-8859-1 file contents | |
17 | python -c 'fp = open("isolatin", "w"); fp.write("h\xFCbsch\n"); fp.close();' |
|
17 | python -c 'fp = open("isolatin", "w"); fp.write("h\xFCbsch\n"); fp.close();' | |
18 |
|
18 | |||
19 | hg ci -Ama |
|
19 | hg ci -Ama | |
20 |
|
20 | |||
21 | echo % hg serve |
|
21 | echo % hg serve | |
22 | hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log |
|
22 | hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log | |
23 | cat hg.pid >> $DAEMON_PIDS |
|
23 | cat hg.pid >> $DAEMON_PIDS | |
24 |
|
24 | |||
25 | echo % hgweb filerevision, html |
|
25 | echo % hgweb filerevision, html | |
26 | ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/get-with-headers.py') \ |
|
26 | ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/get-with-headers.py') \ | |
27 | | sed "s/class=\"k\"/class=\"kn\"/g" |
|
27 | | sed "s/class=\"k\"/class=\"kn\"/g" | |
28 |
|
28 | |||
29 | echo % hgweb filerevision, html |
|
29 | echo % hgweb filerevision, html | |
30 | ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/isolatin') \ |
|
30 | ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/isolatin') \ | |
31 | | sed "s/class=\"k\"/class=\"kn\"/g" |
|
31 | | sed "s/class=\"k\"/class=\"kn\"/g" | |
32 |
|
32 | |||
33 | echo % hgweb fileannotate, html |
|
33 | echo % hgweb fileannotate, html | |
34 | ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/get-with-headers.py') \ |
|
34 | ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/get-with-headers.py') \ | |
35 | | sed "s/class=\"k\"/class=\"kn\"/g" |
|
35 | | sed "s/class=\"k\"/class=\"kn\"/g" | |
36 |
|
36 | |||
37 | echo % hgweb fileannotate, raw |
|
37 | echo % hgweb fileannotate, raw | |
38 | ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/get-with-headers.py?style=raw') \ |
|
38 | ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/get-with-headers.py?style=raw') \ | |
39 | | sed "s/test@//" > a |
|
39 | | sed "s/test@//" > a | |
40 |
|
40 | |||
41 | echo "200 Script output follows" > b |
|
41 | echo "200 Script output follows" > b | |
42 | echo "" >> b |
|
42 | echo "" >> b | |
43 | echo "" >> b |
|
43 | echo "" >> b | |
44 | hg annotate "get-with-headers.py" >> b |
|
44 | hg annotate "get-with-headers.py" >> b | |
45 | echo "" >> b |
|
45 | echo "" >> b | |
46 | echo "" >> b |
|
46 | echo "" >> b | |
47 | echo "" >> b |
|
47 | echo "" >> b | |
48 | echo "" >> b |
|
48 | echo "" >> b | |
49 |
|
49 | |||
50 | diff -u b a |
|
50 | diff -u b a | |
51 |
|
51 | |||
52 | echo |
|
52 | echo | |
53 | echo % hgweb filerevision, raw |
|
53 | echo % hgweb filerevision, raw | |
54 | ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/get-with-headers.py?style=raw') \ |
|
54 | ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/get-with-headers.py?style=raw') \ | |
55 | > a |
|
55 | > a | |
56 |
|
56 | |||
57 | echo "200 Script output follows" > b |
|
57 | echo "200 Script output follows" > b | |
58 | echo "" >> b |
|
58 | echo "" >> b | |
59 | hg cat get-with-headers.py >> b |
|
59 | hg cat get-with-headers.py >> b | |
60 |
|
60 | |||
61 | diff -u b a |
|
61 | diff -u b a | |
62 |
|
62 | |||
63 | echo |
|
63 | echo | |
64 | echo % hgweb highlightcss friendly |
|
64 | echo % hgweb highlightcss friendly | |
65 | "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/highlightcss' > out |
|
65 | "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/highlightcss' > out | |
66 | head -n 4 out |
|
66 | head -n 4 out | |
67 | rm out |
|
67 | rm out | |
68 |
|
68 | |||
69 | echo % errors encountered |
|
69 | echo % errors encountered | |
70 | cat errors.log |
|
70 | cat errors.log | |
71 | kill `cat hg.pid` |
|
71 | "$TESTDIR/killdaemons.py" | |
72 |
|
72 | |||
73 | # Change the pygments style |
|
73 | # Change the pygments style | |
74 | cat > .hg/hgrc <<EOF |
|
74 | cat > .hg/hgrc <<EOF | |
75 | [web] |
|
75 | [web] | |
76 | pygments_style = fruity |
|
76 | pygments_style = fruity | |
77 | EOF |
|
77 | EOF | |
78 |
|
78 | |||
79 | echo % hg serve again |
|
79 | echo % hg serve again | |
80 | hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log |
|
80 | hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log | |
81 | cat hg.pid >> $DAEMON_PIDS |
|
81 | cat hg.pid >> $DAEMON_PIDS | |
82 |
|
82 | |||
83 | echo % hgweb highlightcss fruity |
|
83 | echo % hgweb highlightcss fruity | |
84 | "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/highlightcss' > out |
|
84 | "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/highlightcss' > out | |
85 | head -n 4 out |
|
85 | head -n 4 out | |
86 | rm out |
|
86 | rm out | |
87 |
|
87 | |||
88 | echo % errors encountered |
|
88 | echo % errors encountered | |
89 | cat errors.log |
|
89 | cat errors.log | |
90 |
|
General Comments 0
You need to be logged in to leave comments.
Login now