# HG changeset patch # User Jim Hague # Date 2011-07-05 10:53:32 # Node ID 0407b7613e990dac2dc4ad98e2b206bd38c4ede2 # Parent 35f5cfdd042711fbbf1b95eb5b59193921d81808 treediscovery: rename stop() in tests to fix failures on AIX. It seems ksh, the default shell on AIX, does not permit the creation of a function called stop(). test-treediscovery.t and test-treediscovery-legacy.t both fail on AIX with error 'syntax error at line 25 : `(' unexpected'. Fix by renaming stop() in the scripts to tstop(). For completeness rename start() to tstart() to match. Both tests then pass on AIX. Add check for the use of stop() in a shell script to check-code. diff --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -68,6 +68,7 @@ testpats = [ (r'touch -d', "don't use 'touch -d', use 'touch -t' instead"), (r'ls\s+[^|-]+\s+-', "options to 'ls' must come before filenames"), (r'[^>]>\s*\$HGRCPATH', "don't overwrite $HGRCPATH, append to it"), + (r'stop\(\)', "don't use 'stop' as a shell function name"), ], # warnings [] diff --git a/tests/test-treediscovery-legacy.t b/tests/test-treediscovery-legacy.t --- a/tests/test-treediscovery-legacy.t +++ b/tests/test-treediscovery-legacy.t @@ -17,7 +17,7 @@ Setup HTTP server control: $ remote=http://localhost:$HGPORT/ $ export remote - $ start() { + $ tstart() { > echo '[web]' > $1/.hg/hgrc > echo 'push_ssl = false' >> $1/.hg/hgrc > echo 'allow_push = *' >> $1/.hg/hgrc @@ -25,7 +25,7 @@ Setup HTTP server control: > hg serve -R $1 -p $HGPORT -d --pid-file=hg.pid -E errors.log > cat hg.pid >> $DAEMON_PIDS > } - $ stop() { + $ tstop() { > "$TESTDIR/killdaemons.py" > cp $HGRCPATH-withcap $HGRCPATH > } @@ -34,7 +34,7 @@ Both are empty: $ hg init empty1 $ hg init empty2 - $ start empty2 + $ tstart empty2 $ hg incoming -R empty1 $remote comparing with http://localhost:$HGPORT/ no changes found @@ -49,7 +49,7 @@ Both are empty: $ hg push -R empty1 $remote pushing to http://localhost:$HGPORT/ no changes found - $ stop + $ tstop Base repo: @@ -82,7 +82,7 @@ Base repo: o 0 d57206cc072a: r0 $ cd .. - $ start main + $ tstart main Full clone: @@ -199,7 +199,7 @@ Local is subset: Remote is empty: - $ stop ; start empty2 + $ tstop ; tstart empty2 $ cd main $ hg incoming $remote comparing with http://localhost:$HGPORT/ @@ -241,7 +241,7 @@ Remote is empty: Local is superset: - $ stop + $ tstop $ hg clone main subset2 --rev name2 adding changesets adding manifests @@ -249,7 +249,7 @@ Local is superset: added 6 changesets with 12 changes to 2 files updating to branch name2 2 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ start subset2 + $ tstart subset2 $ cd main $ hg incoming $remote comparing with http://localhost:$HGPORT/ @@ -291,7 +291,7 @@ Local is superset: Partial pull: - $ stop ; start main + $ tstop ; tstart main $ hg clone $remote partial --rev name2 abort: partial pull cannot be done because other repository doesn't support changegroupsubset. [255] @@ -306,5 +306,5 @@ Partial pull: [255] $ cd .. - $ stop + $ tstop diff --git a/tests/test-treediscovery.t b/tests/test-treediscovery.t --- a/tests/test-treediscovery.t +++ b/tests/test-treediscovery.t @@ -13,14 +13,14 @@ Setup HTTP server control: $ remote=http://localhost:$HGPORT/ $ export remote - $ start() { + $ tstart() { > echo '[web]' > $1/.hg/hgrc > echo 'push_ssl = false' >> $1/.hg/hgrc > echo 'allow_push = *' >> $1/.hg/hgrc > hg serve -R $1 -p $HGPORT -d --pid-file=hg.pid -E errors.log > cat hg.pid >> $DAEMON_PIDS > } - $ stop() { + $ tstop() { > "$TESTDIR/killdaemons.py" > } @@ -28,7 +28,7 @@ Both are empty: $ hg init empty1 $ hg init empty2 - $ start empty2 + $ tstart empty2 $ hg incoming -R empty1 $remote comparing with http://localhost:$HGPORT/ no changes found @@ -43,7 +43,7 @@ Both are empty: $ hg push -R empty1 $remote pushing to http://localhost:$HGPORT/ no changes found - $ stop + $ tstop Base repo: @@ -76,7 +76,7 @@ Base repo: o 0 d57206cc072a: r0 $ cd .. - $ start main + $ tstart main Full clone: @@ -187,7 +187,7 @@ Local is subset: Remote is empty: - $ stop ; start empty2 + $ tstop ; tstart empty2 $ cd main $ hg incoming $remote comparing with http://localhost:$HGPORT/ @@ -229,7 +229,7 @@ Remote is empty: Local is superset: - $ stop + $ tstop $ hg clone main subset2 --rev name2 adding changesets adding manifests @@ -237,7 +237,7 @@ Local is superset: added 6 changesets with 12 changes to 2 files updating to branch name2 2 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ start subset2 + $ tstart subset2 $ cd main $ hg incoming $remote comparing with http://localhost:$HGPORT/ @@ -279,7 +279,7 @@ Local is superset: Partial pull: - $ stop ; start main + $ tstop ; tstart main $ hg clone $remote partial --rev name2 adding changesets adding manifests @@ -321,12 +321,12 @@ Partial pull: Both have new stuff in new named branches: - $ stop + $ tstop $ hg clone main repo1a --rev name1 -q $ hg clone repo1a repo1b -q $ hg clone main repo2a --rev name2 -q $ hg clone repo2a repo2b -q - $ start repo1a + $ tstart repo1a $ cd repo2a $ hg incoming $remote @@ -369,7 +369,7 @@ Both have new stuff in new named branche [1] $ cd .. - $ stop ; start repo1b + $ tstop ; tstart repo1b $ cd repo2b $ hg incoming $remote comparing with http://localhost:$HGPORT/ @@ -413,13 +413,13 @@ Both have new stuff in new named branche Both have new stuff in existing named branches: - $ stop + $ tstop $ rm -r repo1a repo1b repo2a repo2b $ hg clone main repo1a --rev 3 --rev 8 -q $ hg clone repo1a repo1b -q $ hg clone main repo2a --rev 4 --rev 7 -q $ hg clone repo2a repo2b -q - $ start repo1a + $ tstart repo1a $ cd repo2a $ hg incoming $remote @@ -457,7 +457,7 @@ Both have new stuff in existing named br [1] $ cd .. - $ stop ; start repo1b + $ tstop ; tstart repo1b $ cd repo2b $ hg incoming $remote comparing with http://localhost:$HGPORT/ @@ -494,5 +494,5 @@ Both have new stuff in existing named br [1] $ cd .. - $ stop + $ tstop