# HG changeset patch # User Patrick Mezard # Date 1345495011 -7200 # Node ID d5a3bda6e1700b0de95697d1456938e89225c018 # Parent 2d4a096e213cb89ca42f31b08ee53db1e9b41392 killdaemons: take file argument explicitely It makes it easier to use as a generic replacement for kill utility, mostly for Windows tests. diff -r 2d4a096e213c -r d5a3bda6e170 tests/killdaemons.py --- a/tests/killdaemons.py Sun Aug 19 18:06:15 2012 +0200 +++ b/tests/killdaemons.py Mon Aug 20 22:36:51 2012 +0200 @@ -1,6 +1,6 @@ #!/usr/bin/env python -import os, time, errno, signal +import os, sys, time, errno, signal if os.name =='nt': import ctypes @@ -49,5 +49,6 @@ pass if __name__ == '__main__': - killdaemons(os.environ['DAEMON_PIDS']) + path, = sys.argv[1:] + killdaemons(path) diff -r 2d4a096e213c -r d5a3bda6e170 tests/test-archive.t --- a/tests/test-archive.t Sun Aug 19 18:06:15 2012 +0200 +++ b/tests/test-archive.t Mon Aug 20 22:36:51 2012 +0200 @@ -24,7 +24,7 @@ > echo % $3 and $4 disallowed should both give 403 > "$TESTDIR/get-with-headers.py" localhost:$HGPORT "archive/tip.$3" | head -n 1 > "$TESTDIR/get-with-headers.py" localhost:$HGPORT "archive/tip.$4" | head -n 1 - > "$TESTDIR/killdaemons.py" + > "$TESTDIR/killdaemons.py" $DAEMON_PIDS > cat errors.log > cp .hg/hgrc-base .hg/hgrc > } @@ -93,7 +93,7 @@ testing: test-archive-2c0277f05ed4/foo OK No errors detected in compressed data of archive.zip. - $ "$TESTDIR/killdaemons.py" + $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS $ hg archive -t tar test.tar $ tar tf test.tar diff -r 2d4a096e213c -r d5a3bda6e170 tests/test-hgweb-commands.t --- a/tests/test-hgweb-commands.t Sun Aug 19 18:06:15 2012 +0200 +++ b/tests/test-hgweb-commands.t Mon Aug 20 22:36:51 2012 +0200 @@ -1260,7 +1260,7 @@ Stop and restart with HGENCODING=cp932 and preferuncompressed - $ "$TESTDIR/killdaemons.py" + $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS $ HGENCODING=cp932 hg serve --config server.preferuncompressed=True -n test \ > -p $HGPORT -d --pid-file=hg.pid -E errors.log $ cat hg.pid >> $DAEMON_PIDS @@ -1288,7 +1288,7 @@ ERRORS ENCOUNTERED $ cat errors.log - $ "$TESTDIR/killdaemons.py" + $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS $ cd .. diff -r 2d4a096e213c -r d5a3bda6e170 tests/test-hgweb-diffs.t --- a/tests/test-hgweb-diffs.t Sun Aug 19 18:06:15 2012 +0200 +++ b/tests/test-hgweb-diffs.t Mon Aug 20 22:36:51 2012 +0200 @@ -291,7 +291,7 @@ set up hgweb with git diffs - $ "$TESTDIR/killdaemons.py" + $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS $ hg serve --config 'diff.git=1' -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS @@ -936,7 +936,7 @@ raw revision with diff block numbers - $ "$TESTDIR/killdaemons.py" + $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS $ cat < .hg/hgrc > [web] > templates = rawdiff @@ -973,7 +973,7 @@ @@ -0,0 +1,1 @@ +b - $ "$TESTDIR/killdaemons.py" + $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS $ rm .hg/hgrc rawdiff/map $ rmdir rawdiff $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log diff -r 2d4a096e213c -r d5a3bda6e170 tests/test-hgweb.t --- a/tests/test-hgweb.t Sun Aug 19 18:06:15 2012 +0200 +++ b/tests/test-hgweb.t Mon Aug 20 22:36:51 2012 +0200 @@ -299,7 +299,7 @@ stop and restart - $ "$TESTDIR/killdaemons.py" + $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log $ cat hg.pid >> $DAEMON_PIDS diff -r 2d4a096e213c -r d5a3bda6e170 tests/test-hgwebdir.t --- a/tests/test-hgwebdir.t Sun Aug 19 18:06:15 2012 +0200 +++ b/tests/test-hgwebdir.t Mon Aug 20 22:36:51 2012 +0200 @@ -657,7 +657,7 @@ Test collapse = True - $ "$TESTDIR/killdaemons.py" + $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS $ cat >> paths.conf < [web] > collapse=true @@ -723,7 +723,7 @@ Test descend = False - $ "$TESTDIR/killdaemons.py" + $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS $ cat >> paths.conf < descend=false > EOF @@ -784,7 +784,7 @@ $ hg id http://localhost:$HGPORT1/astar 8580ff50825a - $ "$TESTDIR/killdaemons.py" + $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS $ cat > paths.conf < [paths] > t/a = $root/a @@ -812,7 +812,7 @@ Test collapse = True - $ "$TESTDIR/killdaemons.py" + $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS $ cat >> paths.conf < [web] > collapse=true @@ -837,7 +837,7 @@ test descend = False - $ "$TESTDIR/killdaemons.py" + $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS $ cat >> paths.conf < descend=false > EOF @@ -857,7 +857,7 @@ /t/a/ /t/b/ - $ "$TESTDIR/killdaemons.py" + $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS $ cat > paths.conf < [paths] > nostore = $root/nostore @@ -956,7 +956,7 @@ $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 'a/rss-log' | grep 'http://hg.example.com:8080/a/rev/8580ff50825a - $ "$TESTDIR/killdaemons.py" + $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS $ hg serve --config web.baseurl=http://hg.example.com:8080/foo/ -p $HGPORT2 -d \ > --pid-file=hg.pid --webdir-conf collections.conf \ > -A access-collections-2.log -E error-collections-2.log diff -r 2d4a096e213c -r d5a3bda6e170 tests/test-highlight.t --- a/tests/test-highlight.t Sun Aug 19 18:06:15 2012 +0200 +++ b/tests/test-highlight.t Mon Aug 20 22:36:51 2012 +0200 @@ -545,7 +545,7 @@ errors encountered $ cat errors.log - $ "$TESTDIR/killdaemons.py" + $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS Change the pygments style @@ -579,7 +579,7 @@ $ hg ci -Ama adding eucjp.txt $ hgserveget () { - > "$TESTDIR/killdaemons.py" + > "$TESTDIR/killdaemons.py" $DAEMON_PIDS > echo % HGENCODING="$1" hg serve > HGENCODING="$1" hg serve -p $HGPORT -d -n test --pid-file=hg.pid -E errors.log > cat hg.pid >> $DAEMON_PIDS diff -r 2d4a096e213c -r d5a3bda6e170 tests/test-largefiles.t --- a/tests/test-largefiles.t Sun Aug 19 18:06:15 2012 +0200 +++ b/tests/test-largefiles.t Mon Aug 20 22:36:51 2012 +0200 @@ -200,7 +200,7 @@ -rw-r--r-- 9 normal4 - $ "$TESTDIR/killdaemons.py" + $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS #endif Test archiving the various revisions. These hit corner cases known with @@ -1166,7 +1166,7 @@ [255] used all HGPORTs, kill all daemons - $ "$TESTDIR/killdaemons.py" + $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS #endif vanilla clients locked out from largefiles ssh repos @@ -1252,7 +1252,7 @@ $ rm -rf empty used all HGPORTs, kill all daemons - $ "$TESTDIR/killdaemons.py" + $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS #endif diff -r 2d4a096e213c -r d5a3bda6e170 tests/test-pull-http.t --- a/tests/test-pull-http.t Sun Aug 19 18:06:15 2012 +0200 +++ b/tests/test-pull-http.t Mon Aug 20 22:36:51 2012 +0200 @@ -28,7 +28,7 @@ $ cat test3/.hg/hgrc [paths] default = http://foo@localhost:$HGPORT/ - $ "$TESTDIR/killdaemons.py" + $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS expect error, cloning not allowed @@ -40,7 +40,7 @@ requesting all changes abort: authorization failed [255] - $ "$TESTDIR/killdaemons.py" + $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS serve errors diff -r 2d4a096e213c -r d5a3bda6e170 tests/test-push-http.t --- a/tests/test-push-http.t Sun Aug 19 18:06:15 2012 +0200 +++ b/tests/test-push-http.t Mon Aug 20 22:36:51 2012 +0200 @@ -17,7 +17,7 @@ > cat hg.pid >> $DAEMON_PIDS > hg --cwd ../test2 push http://localhost:$HGPORT/ > exitstatus=$? - > "$TESTDIR/killdaemons.py" + > "$TESTDIR/killdaemons.py" $DAEMON_PIDS > echo % serve errors > cat errors.log > return $exitstatus diff -r 2d4a096e213c -r d5a3bda6e170 tests/test-subrepo-relative-path.t --- a/tests/test-subrepo-relative-path.t Sun Aug 19 18:06:15 2012 +0200 +++ b/tests/test-subrepo-relative-path.t Mon Aug 20 22:36:51 2012 +0200 @@ -70,7 +70,7 @@ source ../sub revision 863c1745b441bd97a8c4a096e87793073f4fb215 - $ "$TESTDIR/killdaemons.py" + $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS subrepo paths with ssh urls diff -r 2d4a096e213c -r d5a3bda6e170 tests/test-treediscovery-legacy.t --- a/tests/test-treediscovery-legacy.t Sun Aug 19 18:06:15 2012 +0200 +++ b/tests/test-treediscovery-legacy.t Mon Aug 20 22:36:51 2012 +0200 @@ -35,7 +35,7 @@ > cat hg.pid >> $DAEMON_PIDS > } $ tstop() { - > "$TESTDIR/killdaemons.py" + > "$TESTDIR/killdaemons.py" $DAEMON_PIDS > cp $HGRCPATH-withcap $HGRCPATH > } diff -r 2d4a096e213c -r d5a3bda6e170 tests/test-treediscovery.t --- a/tests/test-treediscovery.t Sun Aug 19 18:06:15 2012 +0200 +++ b/tests/test-treediscovery.t Mon Aug 20 22:36:51 2012 +0200 @@ -23,7 +23,7 @@ > cat hg.pid >> $DAEMON_PIDS > } $ tstop() { - > "$TESTDIR/killdaemons.py" + > "$TESTDIR/killdaemons.py" $DAEMON_PIDS > } Both are empty: