Show More
@@ -1,58 +1,58 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 e |
|
43 | echo '% With -v and -p daytime (should fail because low port)' | |
44 | KILLQUIETLY=Y |
|
44 | KILLQUIETLY=Y | |
45 |
hgserve -p e |
|
45 | hgserve -p daytime | |
46 | KILLQUIETLY=N |
|
46 | KILLQUIETLY=N | |
47 |
|
47 | |||
48 | echo % With --prefix foo |
|
48 | echo % With --prefix foo | |
49 | hgserve --prefix foo |
|
49 | hgserve --prefix foo | |
50 |
|
50 | |||
51 | echo % With --prefix /foo |
|
51 | echo % With --prefix /foo | |
52 | hgserve --prefix /foo |
|
52 | hgserve --prefix /foo | |
53 |
|
53 | |||
54 | echo % With --prefix foo/ |
|
54 | echo % With --prefix foo/ | |
55 | hgserve --prefix foo/ |
|
55 | hgserve --prefix foo/ | |
56 |
|
56 | |||
57 | echo % With --prefix /foo/ |
|
57 | echo % With --prefix /foo/ | |
58 | hgserve --prefix /foo/ |
|
58 | hgserve --prefix /foo/ |
@@ -1,25 +1,25 b'' | |||||
1 | % Without -v |
|
1 | % Without -v | |
2 | access log created - .hg/hgrc respected |
|
2 | access log created - .hg/hgrc respected | |
3 | % errors |
|
3 | % errors | |
4 | % With -v |
|
4 | % With -v | |
5 | listening at http://localhost/ (bound to 127.0.0.1:HGPORT1) |
|
5 | listening at http://localhost/ (bound to 127.0.0.1:HGPORT1) | |
6 | % errors |
|
6 | % errors | |
7 | % With -v and -p HGPORT2 |
|
7 | % With -v and -p HGPORT2 | |
8 | listening at http://localhost/ (bound to 127.0.0.1:HGPORT2) |
|
8 | listening at http://localhost/ (bound to 127.0.0.1:HGPORT2) | |
9 | % errors |
|
9 | % errors | |
10 |
% With -v and -p e |
|
10 | % With -v and -p daytime (should fail because low port) | |
11 |
abort: cannot start server at 'localhost: |
|
11 | abort: cannot start server at 'localhost:13': Permission denied | |
12 | abort: child process failed to start |
|
12 | abort: child process failed to start | |
13 | % errors |
|
13 | % errors | |
14 | % With --prefix foo |
|
14 | % With --prefix foo | |
15 | listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1) |
|
15 | listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1) | |
16 | % errors |
|
16 | % errors | |
17 | % With --prefix /foo |
|
17 | % With --prefix /foo | |
18 | listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1) |
|
18 | listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1) | |
19 | % errors |
|
19 | % errors | |
20 | % With --prefix foo/ |
|
20 | % With --prefix foo/ | |
21 | listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1) |
|
21 | listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1) | |
22 | % errors |
|
22 | % errors | |
23 | % With --prefix /foo/ |
|
23 | % With --prefix /foo/ | |
24 | listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1) |
|
24 | listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1) | |
25 | % errors |
|
25 | % errors |
General Comments 0
You need to be logged in to leave comments.
Login now