Mercurial > hg
comparison tests/test-serve @ 12076:49463314c24f
mail/hgweb: support service names for ports (issue2350)
This adds util.getport(port) which tries to parse port as an int, and
failing that, looks it up using socket.getservbyname(). Thus, the
following will work:
[smtp]
port = submission
[web]
port = http
This does not apply to ports in URLs used in clone, pull, etc.
author | Brodie Rao <brodie@bitheap.org> |
---|---|
date | Sat, 28 Aug 2010 12:31:07 -0400 |
parents | 3318431f2ab4 |
children | b6cc68ef2702 |
comparison
equal
deleted
inserted
replaced
12075:f585c9bb85c1 | 12076:49463314c24f |
---|---|
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 kill `cat hg.pid` | 13 if [ "$KILLQUIETLY" = "Y" ]; then |
14 kill `cat hg.pid` 2>/dev/null | |
15 else | |
16 kill `cat hg.pid` | |
17 fi | |
14 sleep 1 | 18 sleep 1 |
15 } | 19 } |
16 | 20 |
17 hg init test | 21 hg init test |
18 cd test | 22 cd test |
34 hgserve | 38 hgserve |
35 | 39 |
36 echo % With -v and -p HGPORT2 | 40 echo % With -v and -p HGPORT2 |
37 hgserve -p "$HGPORT2" | 41 hgserve -p "$HGPORT2" |
38 | 42 |
43 echo '% With -v and -p http (should fail)' | |
44 KILLQUIETLY=Y hgserve -p http | |
45 | |
39 echo % With --prefix foo | 46 echo % With --prefix foo |
40 hgserve --prefix foo | 47 hgserve --prefix foo |
41 | 48 |
42 echo % With --prefix /foo | 49 echo % With --prefix /foo |
43 hgserve --prefix /foo | 50 hgserve --prefix /foo |