Show More
@@ -1,81 +1,81 | |||
|
1 | 1 | #require serve |
|
2 | 2 | |
|
3 | 3 | $ hgserve() |
|
4 | 4 | > { |
|
5 | 5 | > hg serve -a localhost -d --pid-file=hg.pid -E errors.log -v $@ \ |
|
6 | 6 | > | sed -e "s/:$HGPORT1\\([^0-9]\\)/:HGPORT1\1/g" \ |
|
7 | 7 | > -e "s/:$HGPORT2\\([^0-9]\\)/:HGPORT2\1/g" \ |
|
8 | 8 | > -e 's/http:\/\/[^/]*\//http:\/\/localhost\//' |
|
9 | 9 | > cat hg.pid >> "$DAEMON_PIDS" |
|
10 | 10 | > echo % errors |
|
11 | 11 | > cat errors.log |
|
12 | 12 | > killdaemons.py hg.pid |
|
13 | 13 | > } |
|
14 | 14 | |
|
15 | 15 | $ hg init test |
|
16 | 16 | $ cd test |
|
17 | 17 | $ echo '[web]' > .hg/hgrc |
|
18 | 18 | $ echo 'accesslog = access.log' >> .hg/hgrc |
|
19 | 19 | $ echo "port = $HGPORT1" >> .hg/hgrc |
|
20 | 20 | |
|
21 | 21 | Without -v |
|
22 | 22 | |
|
23 | 23 | $ hg serve -a localhost -p $HGPORT -d --pid-file=hg.pid -E errors.log |
|
24 | 24 | $ cat hg.pid >> "$DAEMON_PIDS" |
|
25 | 25 | $ if [ -f access.log ]; then |
|
26 | 26 | > echo 'access log created - .hg/hgrc respected' |
|
27 | 27 | > fi |
|
28 | 28 | access log created - .hg/hgrc respected |
|
29 | 29 | |
|
30 | 30 | errors |
|
31 | 31 | |
|
32 | 32 | $ cat errors.log |
|
33 | 33 | |
|
34 | 34 | With -v |
|
35 | 35 | |
|
36 | 36 | $ hgserve |
|
37 | listening at http://localhost/ (bound to 127.0.0.1:HGPORT1) | |
|
37 | listening at http://localhost/ (bound to 127.0.0.1:HGPORT1) (glob) | |
|
38 | 38 | % errors |
|
39 | 39 | |
|
40 | 40 | With -v and -p HGPORT2 |
|
41 | 41 | |
|
42 | 42 | $ hgserve -p "$HGPORT2" |
|
43 | listening at http://localhost/ (bound to 127.0.0.1:HGPORT2) | |
|
43 | listening at http://localhost/ (bound to 127.0.0.1:HGPORT2) (glob) | |
|
44 | 44 | % errors |
|
45 | 45 | |
|
46 | 46 | With -v and -p daytime (should fail because low port) |
|
47 | 47 | |
|
48 | 48 | #if no-root |
|
49 | 49 | $ KILLQUIETLY=Y |
|
50 | 50 | $ hgserve -p daytime |
|
51 | 51 | abort: cannot start server at 'localhost:13': Permission denied |
|
52 | 52 | abort: child process failed to start |
|
53 | 53 | % errors |
|
54 | 54 | $ KILLQUIETLY=N |
|
55 | 55 | #endif |
|
56 | 56 | |
|
57 | 57 | With --prefix foo |
|
58 | 58 | |
|
59 | 59 | $ hgserve --prefix foo |
|
60 | listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1) | |
|
60 | listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1) (glob) | |
|
61 | 61 | % errors |
|
62 | 62 | |
|
63 | 63 | With --prefix /foo |
|
64 | 64 | |
|
65 | 65 | $ hgserve --prefix /foo |
|
66 | listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1) | |
|
66 | listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1) (glob) | |
|
67 | 67 | % errors |
|
68 | 68 | |
|
69 | 69 | With --prefix foo/ |
|
70 | 70 | |
|
71 | 71 | $ hgserve --prefix foo/ |
|
72 | listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1) | |
|
72 | listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1) (glob) | |
|
73 | 73 | % errors |
|
74 | 74 | |
|
75 | 75 | With --prefix /foo/ |
|
76 | 76 | |
|
77 | 77 | $ hgserve --prefix /foo/ |
|
78 | listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1) | |
|
78 | listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1) (glob) | |
|
79 | 79 | % errors |
|
80 | 80 | |
|
81 | 81 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now