tests: don't just silently strip port numbers
authorMads Kiilerich <mads@kiilerich.com>
Mon, 08 Feb 2010 02:53:41 +0100
changeset 10398 ace3cf2bc991
parent 10397 8cb81d75730c
child 10399 e7b97b54cb02
tests: don't just silently strip port numbers
tests/test-fetch
tests/test-fetch.out
tests/test-http
tests/test-http-clone-r
tests/test-http-clone-r.out
tests/test-http.out
tests/test-incoming-outgoing
tests/test-incoming-outgoing.out
tests/test-pull
tests/test-pull-http
tests/test-pull-http.out
tests/test-pull.out
tests/test-push-http
tests/test-push-http.out
tests/test-static-http
tests/test-static-http.out
--- a/tests/test-fetch	Sun Feb 07 10:47:54 2010 -0500
+++ b/tests/test-fetch	Mon Feb 08 02:53:41 2010 +0100
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 # adjust to non-default HGPORT, e.g. with run-tests.py -j
-hideport() { sed "s/localhost:$HGPORT/localhost:20059/"; }
+hideport() { sed "s/localhost:$HGPORT/localhost:\$HGPORT/"; }
 hidehash() { sed "s/changeset 3:............ merges/changeset 3:... merges/"; }
 
 echo "[extensions]" >> $HGRCPATH
--- a/tests/test-fetch.out	Sun Feb 07 10:47:54 2010 -0500
+++ b/tests/test-fetch.out	Mon Feb 08 02:53:41 2010 +0100
@@ -36,7 +36,7 @@
 b
 c
 % fetch over http, no auth
-pulling from http://localhost:20059/
+pulling from http://localhost:$HGPORT/
 searching for changes
 adding changesets
 adding manifests
@@ -47,9 +47,9 @@
 merging with 1:5e056962225c
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 new changeset 3:... merges remote changes with local
-Automated merge with http://localhost:20059/
+Automated merge with http://localhost:$HGPORT/
 % fetch over http with auth (should be hidden in desc)
-pulling from http://user:***@localhost:20059/
+pulling from http://user:***@localhost:$HGPORT/
 searching for changes
 adding changesets
 adding manifests
@@ -60,7 +60,7 @@
 merging with 1:5e056962225c
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 new changeset 3:... merges remote changes with local
-Automated merge with http://localhost:20059/
+Automated merge with http://localhost:$HGPORT/
 updating to branch default
 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
 updating to branch default
--- a/tests/test-http	Sun Feb 07 10:47:54 2010 -0500
+++ b/tests/test-http	Mon Feb 08 02:53:41 2010 +0100
@@ -14,7 +14,7 @@
 hg --config server.uncompressed=True serve -p $HGPORT -d --pid-file=../hg1.pid
 hg serve -p $HGPORT1 -d --pid-file=../hg2.pid
 # Test server address cannot be reused
-hg serve -p $HGPORT1 2>&1 | sed -e "s/abort: cannot start server at ':$HGPORT1':.*/abort: cannot start server at ':20060':/"
+hg serve -p $HGPORT1 2>&1 | sed -e "s/abort: cannot start server at ':$HGPORT1':.*/abort: cannot start server at ':\$HGPORT1':/"
 cd ..
 cat hg1.pid hg2.pid >> $DAEMON_PIDS
 
@@ -39,5 +39,5 @@
 cd copy-pull
 echo '[hooks]' >> .hg/hgrc
 echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
-hg pull | sed -e 's,:[0-9][0-9]*/,/,'
+hg pull | sed -e "s,:$HGPORT1/,:\$HGPORT1/,"
 cd ..
--- a/tests/test-http-clone-r	Sun Feb 07 10:47:54 2010 -0500
+++ b/tests/test-http-clone-r	Mon Feb 08 02:53:41 2010 +0100
@@ -66,14 +66,14 @@
 hg verify
 cd ..
 cd test-1
-hg pull -r 4 http://localhost:$HGPORT/ 2>&1 | sed -e 's,:[0-9][0-9]*/,/,'
+hg pull -r 4 http://localhost:$HGPORT/ 2>&1 | sed -e "s,:$HGPORT/,:\$HGPORT/,"
 hg verify
-hg pull http://localhost:$HGPORT/ 2>&1 | sed -e 's,:[0-9][0-9]*/,/,'
+hg pull http://localhost:$HGPORT/ 2>&1 | sed -e "s,:$HGPORT/,:\$HGPORT/,"
 cd ..
 cd test-2
-hg pull -r 5 http://localhost:$HGPORT/ 2>&1 | sed -e 's,:[0-9][0-9]*/,/,'
+hg pull -r 5 http://localhost:$HGPORT/ 2>&1 | sed -e "s,:$HGPORT/,:\$HGPORT/,"
 hg verify
-hg pull http://localhost:$HGPORT/ 2>&1 | sed -e 's,:[0-9][0-9]*/,/,'
+hg pull http://localhost:$HGPORT/ 2>&1 | sed -e "s,:$HGPORT/,:\$HGPORT/,"
 hg verify
 cd ..
 cat error.log
--- a/tests/test-http-clone-r.out	Sun Feb 07 10:47:54 2010 -0500
+++ b/tests/test-http-clone-r.out	Mon Feb 08 02:53:41 2010 +0100
@@ -148,7 +148,7 @@
 crosschecking files in changesets and manifests
 checking files
 4 files, 9 changesets, 7 total revisions
-pulling from http://localhost/
+pulling from http://localhost:$HGPORT/
 searching for changes
 adding changesets
 adding manifests
@@ -160,14 +160,14 @@
 crosschecking files in changesets and manifests
 checking files
 1 files, 3 changesets, 2 total revisions
-pulling from http://localhost/
+pulling from http://localhost:$HGPORT/
 searching for changes
 adding changesets
 adding manifests
 adding file changes
 added 6 changesets with 5 changes to 4 files
 (run 'hg update' to get a working copy)
-pulling from http://localhost/
+pulling from http://localhost:$HGPORT/
 searching for changes
 adding changesets
 adding manifests
@@ -179,7 +179,7 @@
 crosschecking files in changesets and manifests
 checking files
 1 files, 5 changesets, 3 total revisions
-pulling from http://localhost/
+pulling from http://localhost:$HGPORT/
 searching for changes
 adding changesets
 adding manifests
--- a/tests/test-http.out	Sun Feb 07 10:47:54 2010 -0500
+++ b/tests/test-http.out	Mon Feb 08 02:53:41 2010 +0100
@@ -2,7 +2,7 @@
 adding foo.d/bAr.hg.d/BaR
 adding foo.d/baR.d.hg/bAR
 adding foo.d/foo
-abort: cannot start server at ':20060':
+abort: cannot start server at ':$HGPORT1':
 % clone via stream
 streaming all changes
 XXX files to transfer, XXX bytes of data
@@ -37,8 +37,8 @@
 4 files, 1 changesets, 4 total revisions
 adding bar
 % pull
-changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=http://localhost/ 
-pulling from http://localhost/
+changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=http://localhost:$HGPORT1/ 
+pulling from http://localhost:$HGPORT1/
 searching for changes
 adding changesets
 adding manifests
--- a/tests/test-incoming-outgoing	Sun Feb 07 10:47:54 2010 -0500
+++ b/tests/test-incoming-outgoing	Mon Feb 08 02:53:41 2010 +0100
@@ -14,8 +14,8 @@
 
 hg init new
 # http incoming
-hg -R new incoming http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,'
-hg -R new incoming -r 4 http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,'
+hg -R new incoming http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
+hg -R new incoming -r 4 http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
 # local incoming
 hg -R new incoming test
 hg -R new incoming -r 4 test
@@ -25,7 +25,7 @@
 hg -R new incoming -l 2 -p --git test
 
 # test with --bundle
-hg -R new incoming --bundle test.hg http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,'
+hg -R new incoming --bundle test.hg http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
 hg -R new incoming --bundle test2.hg test
 
 # test the resulting bundles
@@ -50,5 +50,5 @@
 hg -R test-dev outgoing test
 echo "% limit to 3 changesets"
 hg -R test-dev outgoing -l 3 test
-hg -R test-dev outgoing http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,'
-hg -R test-dev outgoing -r 11 http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,'
+hg -R test-dev outgoing http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
+hg -R test-dev outgoing -r 11 http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
--- a/tests/test-incoming-outgoing.out	Sun Feb 07 10:47:54 2010 -0500
+++ b/tests/test-incoming-outgoing.out	Mon Feb 08 02:53:41 2010 +0100
@@ -4,7 +4,7 @@
 crosschecking files in changesets and manifests
 checking files
 1 files, 9 changesets, 9 total revisions
-comparing with http://localhost/
+comparing with http://localhost:$HGPORT/
 changeset:   0:9cb21d99fe27
 user:        test
 date:        Mon Jan 12 13:46:40 1970 +0000
@@ -51,7 +51,7 @@
 date:        Mon Jan 12 13:46:40 1970 +0000
 summary:     8
 
-comparing with http://localhost/
+comparing with http://localhost:$HGPORT/
 changeset:   0:9cb21d99fe27
 user:        test
 date:        Mon Jan 12 13:46:40 1970 +0000
@@ -189,7 +189,7 @@
  0
 +1
 
-comparing with http://localhost/
+comparing with http://localhost:$HGPORT/
 changeset:   0:9cb21d99fe27
 user:        test
 date:        Mon Jan 12 13:46:40 1970 +0000
@@ -358,7 +358,7 @@
 date:        Mon Jan 12 13:46:40 1970 +0000
 summary:     11
 
-comparing with http://localhost/
+comparing with http://localhost:$HGPORT/
 searching for changes
 changeset:   9:3741c3ad1096
 user:        test
@@ -386,7 +386,7 @@
 date:        Mon Jan 12 13:46:40 1970 +0000
 summary:     13
 
-comparing with http://localhost/
+comparing with http://localhost:$HGPORT/
 searching for changes
 changeset:   9:3741c3ad1096
 user:        test
--- a/tests/test-pull	Sun Feb 07 10:47:54 2010 -0500
+++ b/tests/test-pull	Mon Feb 08 02:53:41 2010 +0100
@@ -11,13 +11,13 @@
 cat hg.pid >> $DAEMON_PIDS
 cd ..
 
-hg clone --pull http://localhost:$HGPORT/ copy | sed -e 's,:[0-9][0-9]*/,/,'
+hg clone --pull http://localhost:$HGPORT/ copy | sed -e "s,:$HGPORT/,:\$HGPORT/,"
 cd copy
 hg verify
 hg co
 cat foo
 hg manifest --debug
-hg pull | sed -e 's,:[0-9][0-9]*/,/,'
+hg pull | sed -e "s,:$HGPORT/,:\$HGPORT/,"
 
 echo % issue 622
 cd ..
--- a/tests/test-pull-http	Sun Feb 07 10:47:54 2010 -0500
+++ b/tests/test-pull-http	Mon Feb 08 02:53:41 2010 +0100
@@ -18,7 +18,7 @@
 echo 'allowpull = false' >> .hg/hgrc
 hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
 cat hg.pid >> $DAEMON_PIDS
-hg clone http://localhost:$HGPORT/ test3 | sed -e 's,:[0-9][0-9]*/,/,'
+hg clone http://localhost:$HGPORT/ test3 | sed -e "s,:$HGPORT/,:\$HGPORT/,"
 "$TESTDIR/killdaemons.py"
 echo % serve errors
 cat errors.log
@@ -26,7 +26,7 @@
 req() {
 	hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
 	cat hg.pid >> $DAEMON_PIDS
-	hg --cwd ../test pull http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,'
+	hg --cwd ../test pull http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
 	kill `cat hg.pid`
 	echo % serve errors
 	cat errors.log
--- a/tests/test-pull-http.out	Sun Feb 07 10:47:54 2010 -0500
+++ b/tests/test-pull-http.out	Mon Feb 08 02:53:41 2010 +0100
@@ -7,6 +7,6 @@
 % serve errors
 % expect error, pulling not allowed
 abort: authorization failed
-pulling from http://localhost/
+pulling from http://localhost:$HGPORT/
 searching for changes
 % serve errors
--- a/tests/test-pull.out	Sun Feb 07 10:47:54 2010 -0500
+++ b/tests/test-pull.out	Mon Feb 08 02:53:41 2010 +0100
@@ -19,7 +19,7 @@
 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 foo
 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644   foo
-pulling from http://localhost/
+pulling from http://localhost:$HGPORT/
 searching for changes
 no changes found
 % issue 622
--- a/tests/test-push-http	Sun Feb 07 10:47:54 2010 -0500
+++ b/tests/test-push-http	Mon Feb 08 02:53:41 2010 +0100
@@ -16,7 +16,7 @@
 req() {
 	hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
 	cat hg.pid >> $DAEMON_PIDS
-	hg --cwd ../test2 push http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,'
+	hg --cwd ../test2 push http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
 	kill `cat hg.pid`
 	echo % serve errors
 	cat errors.log
--- a/tests/test-push-http.out	Sun Feb 07 10:47:54 2010 -0500
+++ b/tests/test-push-http.out	Mon Feb 08 02:53:41 2010 +0100
@@ -2,22 +2,22 @@
 updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 % expect ssl error
-pushing to http://localhost/
+pushing to http://localhost:$HGPORT/
 searching for changes
 ssl required
 % serve errors
 % expect authorization error
 abort: authorization failed
-pushing to http://localhost/
+pushing to http://localhost:$HGPORT/
 searching for changes
 % serve errors
 % expect authorization error: must have authorized user
 abort: authorization failed
-pushing to http://localhost/
+pushing to http://localhost:$HGPORT/
 searching for changes
 % serve errors
 % expect success
-pushing to http://localhost/
+pushing to http://localhost:$HGPORT/
 searching for changes
 adding changesets
 adding manifests
@@ -28,11 +28,11 @@
 rolling back last transaction
 % expect authorization error: all users denied
 abort: authorization failed
-pushing to http://localhost/
+pushing to http://localhost:$HGPORT/
 searching for changes
 % serve errors
 % expect authorization error: some users denied, users must be authenticated
 abort: authorization failed
-pushing to http://localhost/
+pushing to http://localhost:$HGPORT/
 searching for changes
 % serve errors
--- a/tests/test-static-http	Sun Feb 07 10:47:54 2010 -0500
+++ b/tests/test-static-http	Mon Feb 08 02:53:41 2010 +0100
@@ -34,7 +34,7 @@
 
 cd ..
 
-hg clone static-http://localhost:$HGPORT/remote local | sed -e 's,:[0-9][0-9]*/,/,'
+hg clone static-http://localhost:$HGPORT/remote local | sed -e "s,:$HGPORT/,:\$HGPORT/,"
 
 cd local
 hg verify
@@ -47,13 +47,13 @@
 cd ../local
 echo '[hooks]' >> .hg/hgrc
 echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
-hg pull | sed -e 's,:[0-9][0-9]*/,/,'
+hg pull | sed -e "s,:$HGPORT/,:\$HGPORT/,"
 
 echo '% trying to push'
 hg update
 echo more foo >> bar
 hg commit -m"test" -d "100000000 0"
-hg push | sed -e 's,:[0-9][0-9]*/,/,'
+hg push | sed -e "s,:$HGPORT/,:\$HGPORT/,"
 
 echo '% test with "/" URI (issue 747)'
 cd ..
@@ -62,26 +62,26 @@
 hg add a
 hg ci -ma
 
-hg clone static-http://localhost:$HGPORT/ local2 | sed -e 's,:[0-9][0-9]*/,/,'
+hg clone static-http://localhost:$HGPORT/ local2 | sed -e "s,:$HGPORT/,:\$HGPORT/,"
 
 cd local2
 hg verify
 cat a
-hg paths | sed -e 's,:[0-9][0-9]*/,/,'
+hg paths | sed -e "s,:$HGPORT/,:\$HGPORT/,"
 
 echo '% test with empty repo (issue965)'
 cd ..
 hg init remotempty
 
-hg clone static-http://localhost:$HGPORT/remotempty local3 | sed -e 's,:[0-9][0-9]*/,/,'
+hg clone static-http://localhost:$HGPORT/remotempty local3 | sed -e "s,:$HGPORT/,:\$HGPORT/,"
 
 cd local3
 hg verify
-hg paths | sed -e 's,:[0-9][0-9]*/,/,'
+hg paths | sed -e "s,:$HGPORT/,:\$HGPORT/,"
 
 echo '% test with non-repo'
 cd ..
 mkdir notarepo
-hg clone static-http://localhost:$HGPORT/notarepo local3 2>&1 | sed -e 's,:[0-9][0-9]*/,/,'
+hg clone static-http://localhost:$HGPORT/notarepo local3 2>&1 | sed -e "s,:$HGPORT/,:\$HGPORT/,"
 
 kill $!
--- a/tests/test-static-http.out	Sun Feb 07 10:47:54 2010 -0500
+++ b/tests/test-static-http.out	Mon Feb 08 02:53:41 2010 +0100
@@ -21,8 +21,8 @@
 1 files, 1 changesets, 1 total revisions
 foo
 adding quux
-changegroup hook: HG_NODE=34401e0e9971e9720b613d9089ffa9a6eefb3d2d HG_SOURCE=pull HG_URL=http://localhost/remote 
-pulling from static-http://localhost/remote
+changegroup hook: HG_NODE=34401e0e9971e9720b613d9089ffa9a6eefb3d2d HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/remote 
+pulling from static-http://localhost:$HGPORT/remote
 searching for changes
 adding changesets
 adding manifests
@@ -32,7 +32,7 @@
 % trying to push
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 abort: cannot lock static-http repository
-pushing to static-http://localhost/remote
+pushing to static-http://localhost:$HGPORT/remote
 % test with "/" URI (issue 747)
 requesting all changes
 adding changesets
@@ -47,7 +47,7 @@
 checking files
 1 files, 1 changesets, 1 total revisions
 a
-default = static-http://localhost/
+default = static-http://localhost:$HGPORT/
 % test with empty repo (issue965)
 no changes found
 updating to branch default
@@ -57,6 +57,6 @@
 crosschecking files in changesets and manifests
 checking files
 0 files, 0 changesets, 0 total revisions
-default = static-http://localhost/remotempty
+default = static-http://localhost:$HGPORT/remotempty
 % test with non-repo
-abort: 'http://localhost/notarepo' does not appear to be an hg repository!
+abort: 'http://localhost:$HGPORT/notarepo' does not appear to be an hg repository!