diff tests/test-archive @ 5384:e3a0c092b4e2

Allow tests to run in parallel.
author Bryan O'Sullivan <bos@serpentine.com>
date Fri, 05 Oct 2007 12:17:01 -0700
parents 0f594cc36aed
children
line wrap: on
line diff
--- a/tests/test-archive
+++ b/tests/test-archive
@@ -13,16 +13,16 @@ hg commit -Am 3 -d '1000000000 0'
 echo "[web]" >> .hg/hgrc
 echo "name = test-archive" >> .hg/hgrc
 echo "allow_archive = gz bz2, zip" >> .hg/hgrc
-hg serve -p 20059 -d --pid-file=hg.pid
+hg serve -p $HGPORT -d --pid-file=hg.pid
 cat hg.pid >> $DAEMON_PIDS
 
 TIP=`hg id -v | cut -f1 -d' '`
 QTIP=`hg id -q`
 cat > getarchive.py <<EOF
-import sys, urllib2
+import os, sys, urllib2
 node, archive = sys.argv[1:]
-f = urllib2.urlopen('http://127.0.0.1:20059/?cmd=archive;node=%s;type=%s'
-                    % (node, archive))
+f = urllib2.urlopen('http://127.0.0.1:%s/?cmd=archive;node=%s;type=%s'
+                    % (os.environ['HGPORT'], node, archive))
 sys.stdout.write(f.read())
 EOF
 http_proxy= python getarchive.py "$TIP" gz | gunzip | tar tf - | sed "s/$QTIP/TIP/"