tests/test-serve
changeset 10633 3318431f2ab4
parent 6461 eb69e7989145
child 12076 49463314c24f
--- a/tests/test-serve	Wed Mar 10 12:38:33 2010 +0100
+++ b/tests/test-serve	Wed Mar 10 22:05:41 2010 +0100
@@ -2,8 +2,10 @@
 
 hgserve()
 {
-    hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -E errors.log -v $@ \
-        | sed -e 's/:[0-9][0-9]*//g' -e 's/http:\/\/[^/]*\//http:\/\/localhost\//'
+    hg serve -a localhost -d --pid-file=hg.pid -E errors.log -v $@ \
+        | sed -e "s/:$HGPORT1\\([^0-9]\\)/:HGPORT1\1/g" \
+              -e "s/:$HGPORT2\\([^0-9]\\)/:HGPORT2\1/g" \
+              -e 's/http:\/\/[^/]*\//http:\/\/localhost\//'
     cat hg.pid >> "$DAEMON_PIDS"
     echo % errors
     cat errors.log
@@ -17,6 +19,7 @@
 
 echo '[web]' > .hg/hgrc
 echo 'accesslog = access.log' >> .hg/hgrc
+echo "port = $HGPORT1" >> .hg/hgrc
 
 echo % Without -v
 hg serve -a localhost -p $HGPORT -d --pid-file=hg.pid -E errors.log
@@ -30,6 +33,9 @@
 echo % With -v
 hgserve
 
+echo % With -v and -p HGPORT2
+hgserve -p "$HGPORT2"
+
 echo % With --prefix foo
 hgserve --prefix foo