Show More
@@ -1,56 +1,56 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | hgserve() |
|
3 | hgserve() | |
4 | { |
|
4 | { | |
5 | hg serve -a localhost -d --pid-file=hg.pid -E errors.log -v $@ \ |
|
5 | hg serve -a localhost -d --pid-file=hg.pid -E errors.log -v $@ \ | |
6 | | sed -e "s/:$HGPORT1\\([^0-9]\\)/:HGPORT1\1/g" \ |
|
6 | | sed -e "s/:$HGPORT1\\([^0-9]\\)/:HGPORT1\1/g" \ | |
7 | -e "s/:$HGPORT2\\([^0-9]\\)/:HGPORT2\1/g" \ |
|
7 | -e "s/:$HGPORT2\\([^0-9]\\)/:HGPORT2\1/g" \ | |
8 | -e 's/http:\/\/[^/]*\//http:\/\/localhost\//' |
|
8 | -e 's/http:\/\/[^/]*\//http:\/\/localhost\//' | |
9 | cat hg.pid >> "$DAEMON_PIDS" |
|
9 | cat hg.pid >> "$DAEMON_PIDS" | |
10 | echo % errors |
|
10 | echo % errors | |
11 | cat errors.log |
|
11 | cat errors.log | |
12 | sleep 1 |
|
12 | sleep 1 | |
13 | if [ "$KILLQUIETLY" = "Y" ]; then |
|
13 | if [ "$KILLQUIETLY" = "Y" ]; then | |
14 | kill `cat hg.pid` 2>/dev/null |
|
14 | kill `cat hg.pid` 2>/dev/null | |
15 | else |
|
15 | else | |
16 | kill `cat hg.pid` |
|
16 | kill `cat hg.pid` | |
17 | fi |
|
17 | fi | |
18 | sleep 1 |
|
18 | sleep 1 | |
19 | } |
|
19 | } | |
20 |
|
20 | |||
21 | hg init test |
|
21 | hg init test | |
22 | cd test |
|
22 | cd test | |
23 |
|
23 | |||
24 | echo '[web]' > .hg/hgrc |
|
24 | echo '[web]' > .hg/hgrc | |
25 | echo 'accesslog = access.log' >> .hg/hgrc |
|
25 | echo 'accesslog = access.log' >> .hg/hgrc | |
26 | echo "port = $HGPORT1" >> .hg/hgrc |
|
26 | echo "port = $HGPORT1" >> .hg/hgrc | |
27 |
|
27 | |||
28 | echo % Without -v |
|
28 | echo % Without -v | |
29 | hg serve -a localhost -p $HGPORT -d --pid-file=hg.pid -E errors.log |
|
29 | hg serve -a localhost -p $HGPORT -d --pid-file=hg.pid -E errors.log | |
30 | cat hg.pid >> "$DAEMON_PIDS" |
|
30 | cat hg.pid >> "$DAEMON_PIDS" | |
31 | if [ -f access.log ]; then |
|
31 | if [ -f access.log ]; then | |
32 | echo 'access log created - .hg/hgrc respected' |
|
32 | echo 'access log created - .hg/hgrc respected' | |
33 | fi |
|
33 | fi | |
34 | echo % errors |
|
34 | echo % errors | |
35 | cat errors.log |
|
35 | cat errors.log | |
36 |
|
36 | |||
37 | echo % With -v |
|
37 | echo % With -v | |
38 | hgserve |
|
38 | hgserve | |
39 |
|
39 | |||
40 | echo % With -v and -p HGPORT2 |
|
40 | echo % With -v and -p HGPORT2 | |
41 | hgserve -p "$HGPORT2" |
|
41 | hgserve -p "$HGPORT2" | |
42 |
|
42 | |||
43 | echo '% With -v and -p http (should fail)' |
|
43 | echo '% With -v and -p http (should fail)' | |
44 | KILLQUIETLY=Y hgserve -p http |
|
44 | KILLQUIETLY=Y hgserve -p http; KILLQUIETLY=N | |
45 |
|
45 | |||
46 | echo % With --prefix foo |
|
46 | echo % With --prefix foo | |
47 | hgserve --prefix foo |
|
47 | hgserve --prefix foo | |
48 |
|
48 | |||
49 | echo % With --prefix /foo |
|
49 | echo % With --prefix /foo | |
50 | hgserve --prefix /foo |
|
50 | hgserve --prefix /foo | |
51 |
|
51 | |||
52 | echo % With --prefix foo/ |
|
52 | echo % With --prefix foo/ | |
53 | hgserve --prefix foo/ |
|
53 | hgserve --prefix foo/ | |
54 |
|
54 | |||
55 | echo % With --prefix /foo/ |
|
55 | echo % With --prefix /foo/ | |
56 | hgserve --prefix /foo/ |
|
56 | hgserve --prefix /foo/ |
General Comments 0
You need to be logged in to leave comments.
Login now