diff --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -75,6 +75,7 @@ testpats = [ (r'^alias\b.*=', "don't use alias, use a function"), (r'if\s*!', "don't use '!' to negate exit status"), (r'/dev/u?random', "don't use entropy, use /dev/zero"), + (r'do\s*true;\s*done', "don't use true as loop body, use sleep 0"), ], # warnings [] @@ -98,8 +99,6 @@ utestpats = [ (uprefix + r'set -e', "don't use set -e"), (uprefix + r'\s', "don't indent commands, use > for continued lines"), (uprefixc + r'( *)\t', "don't use tabs to indent"), - (uprefixc + r'.*do\s*true;\s*done', - "don't use true as loop body, use sleep 0"), ], # warnings [] diff --git a/tests/test-bad-pull.t b/tests/test-bad-pull.t --- a/tests/test-bad-pull.t +++ b/tests/test-bad-pull.t @@ -20,7 +20,7 @@ $ python dumb.py 2> log & $ P=$! - $ while [ ! -f listening ]; do true; done + $ while [ ! -f listening ]; do sleep 0; done $ hg clone http://localhost:$HGPORT/foo copy2 abort: HTTP Error 404: * (glob) [255] diff --git a/tests/test-hgweb-raw.t b/tests/test-hgweb-raw.t --- a/tests/test-hgweb-raw.t +++ b/tests/test-hgweb-raw.t @@ -20,7 +20,7 @@ Test raw style of hgweb $ cat hg.pid >> $DAEMON_PIDS $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw' content-type content-length content-disposition) >getoutput.txt - $ while kill `cat hg.pid` 2>/dev/null; do true; done + $ while kill `cat hg.pid` 2>/dev/null; do sleep 0; done $ cat getoutput.txt 200 Script output follows @@ -41,7 +41,7 @@ Test raw style of hgweb $ cat hg.pid >> $DAEMON_PIDS $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw' content-type content-length content-disposition) >getoutput.txt - $ while kill `cat hg.pid` 2>/dev/null; do true; done + $ while kill `cat hg.pid` 2>/dev/null; do sleep 0; done $ cat getoutput.txt 200 Script output follows diff --git a/tests/test-http-proxy.t b/tests/test-http-proxy.t --- a/tests/test-http-proxy.t +++ b/tests/test-http-proxy.t @@ -9,7 +9,7 @@ $ cat hg.pid >> $DAEMON_PIDS $ cd .. $ "$TESTDIR/tinyproxy.py" $HGPORT1 localhost >proxy.log 2>&1 > $DAEMON_PIDS url for proxy, stream diff --git a/tests/test-https.t b/tests/test-https.t --- a/tests/test-https.t +++ b/tests/test-https.t @@ -233,12 +233,12 @@ Fingerprints $ hg -R copy-pull id https://127.0.0.1:$HGPORT/ 5fed3813f7f5 - $ while kill `cat hg1.pid` 2>/dev/null; do true; done + $ while kill `cat hg1.pid` 2>/dev/null; do sleep 0; done Prepare for connecting through proxy $ "$TESTDIR/tinyproxy.py" $HGPORT1 localhost >proxy.log &1 & - $ while [ ! -f proxy.pid ]; do true; done + $ while [ ! -f proxy.pid ]; do sleep 0; done $ cat proxy.pid >> $DAEMON_PIDS $ echo "[http_proxy]" >> copy-pull/.hg/hgrc