diff --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -72,6 +72,7 @@ testfilters = [ uprefix = r"^ \$ " utestpats = [ + (uprefix + r'.*\|\s*sed', "use regex test output patterns instead of sed"), (uprefix + r'(true|exit 0)', "explicit zero exit unnecessary"), (uprefix + r'.*\$\?', "explicit exit code checks unnecessary"), (uprefix + r'.*\|\| echo.*(fail|error)', diff --git a/tests/test-archive.t b/tests/test-archive.t --- a/tests/test-archive.t +++ b/tests/test-archive.t @@ -74,23 +74,23 @@ invalid arch type should give 404 > % (os.environ['HGPORT'], node, archive)) > sys.stdout.write(f.read()) > EOF - $ python getarchive.py "$TIP" gz | gunzip | tar tf - 2>/dev/null | sed "s/$QTIP/TIP/" - test-archive-TIP/.hg_archival.txt - test-archive-TIP/bar - test-archive-TIP/baz/bletch - test-archive-TIP/foo - $ python getarchive.py "$TIP" bz2 | bunzip2 | tar tf - 2>/dev/null | sed "s/$QTIP/TIP/" - test-archive-TIP/.hg_archival.txt - test-archive-TIP/bar - test-archive-TIP/baz/bletch - test-archive-TIP/foo + $ python getarchive.py "$TIP" gz | gunzip | tar tf - 2>/dev/null + test-archive-2c0277f05ed4/.hg_archival.txt + test-archive-2c0277f05ed4/bar + test-archive-2c0277f05ed4/baz/bletch + test-archive-2c0277f05ed4/foo + $ python getarchive.py "$TIP" bz2 | bunzip2 | tar tf - 2>/dev/null + test-archive-2c0277f05ed4/.hg_archival.txt + test-archive-2c0277f05ed4/bar + test-archive-2c0277f05ed4/baz/bletch + test-archive-2c0277f05ed4/foo $ python getarchive.py "$TIP" zip > archive.zip - $ unzip -t archive.zip | sed "s/$QTIP/TIP/" + $ unzip -t archive.zip Archive: archive.zip - testing: test-archive-TIP/.hg_archival.txt OK - testing: test-archive-TIP/bar OK - testing: test-archive-TIP/baz/bletch OK - testing: test-archive-TIP/foo OK + testing: test-archive-2c0277f05ed4/.hg_archival.txt OK + testing: test-archive-2c0277f05ed4/bar OK + testing: test-archive-2c0277f05ed4/baz/bletch OK + testing: test-archive-2c0277f05ed4/foo OK No errors detected in compressed data of archive.zip. $ "$TESTDIR/killdaemons.py" @@ -109,11 +109,11 @@ invalid arch type should give 404 test/foo $ hg archive -t tgz -p %b-%h test-%h.tar.gz - $ gzip -dc test-$QTIP.tar.gz | tar tf - 2>/dev/null | sed "s/$QTIP/TIP/" - test-TIP/.hg_archival.txt - test-TIP/bar - test-TIP/baz/bletch - test-TIP/foo + $ gzip -dc test-$QTIP.tar.gz | tar tf - 2>/dev/null + test-2c0277f05ed4/.hg_archival.txt + test-2c0277f05ed4/bar + test-2c0277f05ed4/baz/bletch + test-2c0277f05ed4/foo $ hg archive autodetected_test.tar $ tar tf autodetected_test.tar @@ -175,11 +175,11 @@ archives and rename them afterwards. testing: test/foo OK No errors detected in compressed data of test.zip. - $ hg archive -t tar - | tar tf - 2>/dev/null | sed "s/$QTIP/TIP/" - test-TIP/.hg_archival.txt - test-TIP/bar - test-TIP/baz/bletch - test-TIP/foo + $ hg archive -t tar - | tar tf - 2>/dev/null + test-2c0277f05ed4/.hg_archival.txt + test-2c0277f05ed4/bar + test-2c0277f05ed4/baz/bletch + test-2c0277f05ed4/foo $ hg archive -r 0 -t tar rev-%r.tar $ if [ -f rev-0.tar ]; then diff --git a/tests/test-bisect.t b/tests/test-bisect.t --- a/tests/test-bisect.t +++ b/tests/test-bisect.t @@ -277,6 +277,7 @@ skip $ hg bisect -g tip $ hg bisect -b tip abort: starting revisions are not directly related + [255] $ hg bisect -r $ hg bisect -g null @@ -349,6 +350,7 @@ test no action $ hg bisect -r $ hg bisect abort: cannot bisect (no known good revisions) + [255] reproduce AssertionError, issue1445 diff --git a/tests/test-export.t b/tests/test-export.t --- a/tests/test-export.t +++ b/tests/test-export.t @@ -81,13 +81,13 @@ Exporting 4 changesets to a file: $ hg export -o export_internal 1 2 3 4 - $ grep HG export_internal | wc -l | sed -e 's/^ *//' - 4 + $ grep HG export_internal | wc -l + \s*4 Exporting 4 changesets to a file: - $ hg export 1 2 3 4 | grep HG | wc -l | sed -e 's/^ *//' - 4 + $ hg export 1 2 3 4 | grep HG | wc -l + \s*4 Exporting revision -2 to a file: diff --git a/tests/test-hgignore.t b/tests/test-hgignore.t --- a/tests/test-hgignore.t +++ b/tests/test-hgignore.t @@ -43,8 +43,9 @@ Should display baz only: ? syntax $ echo "*.o" > .hgignore - $ hg status 2>&1 | sed -e 's/abort: .*\.hgignore:/abort: .hgignore:/' - abort: .hgignore: invalid pattern (relre): *.o + $ hg status + abort: .*/.hgignore: invalid pattern \(relre\): \*.o + [255] $ echo ".*\.o" > .hgignore $ hg status @@ -86,8 +87,8 @@ Check it does not ignore the current dir ? syntax $ echo "syntax: invalid" > .hgignore - $ hg status 2>&1 | sed -e 's/.*\.hgignore:/.hgignore:/' - .hgignore: ignoring invalid syntax 'invalid' + $ hg status + .*/.hgignore: ignoring invalid syntax 'invalid' A dir/b.o ? .hgignore ? a.c diff --git a/tests/test-hgrc.t b/tests/test-hgrc.t --- a/tests/test-hgrc.t +++ b/tests/test-hgrc.t @@ -1,6 +1,7 @@ $ echo "invalid" > $HGRCPATH - $ hg version 2>&1 | sed -e "s|$HGRCPATH|\$HGRCPATH|" - hg: parse error at $HGRCPATH:1: invalid + $ hg version + hg: parse error at .*/\.hgrc:1: invalid + [255] $ echo "" > $HGRCPATH issue1199: escaping @@ -11,22 +12,23 @@ issue1199: escaping 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ p=`pwd` $ cd foobar - $ cat .hg/hgrc | sed -e "s:$p:...:" + $ cat .hg/hgrc [paths] - default = .../foo%bar - $ hg paths | sed -e "s:$p:...:" - default = .../foo%bar - $ hg showconfig | sed -e "s:$p:...:" - bundle.mainreporoot=.../foobar - paths.default=.../foo%bar + default = .*/foo%bar + $ hg paths + default = .*/foo%bar + $ hg showconfig + bundle.mainreporoot=.*/foobar + paths.default=.*/foo%bar $ cd .. issue1829: wrong indentation $ echo '[foo]' > $HGRCPATH $ echo ' x = y' >> $HGRCPATH - $ hg version 2>&1 | sed -e "s|$HGRCPATH|\$HGRCPATH|" - hg: parse error at $HGRCPATH:2: x = y + $ hg version + hg: parse error at .*/\.hgrc:2: x = y + [255] $ python -c "print '[foo]\nbar = a\n b\n c \n de\n fg \nbaz = bif cb \n'" \ > > $HGRCPATH @@ -37,8 +39,9 @@ issue1829: wrong indentation $ FAKEPATH=/path/to/nowhere $ export FAKEPATH $ echo '%include $FAKEPATH/no-such-file' > $HGRCPATH - $ hg version 2>&1 | sed -e "s|$HGRCPATH|\$HGRCPATH|" - hg: parse error at $HGRCPATH:1: cannot include /path/to/nowhere/no-such-file (No such file or directory) + $ hg version + hg: parse error at .*/.hgrc:1: cannot include /path/to/nowhere/no-such-file \(No such file or directory\) + [255] $ unset FAKEPATH username expansion @@ -86,24 +89,24 @@ HGPLAIN customized hgrc - $ hg showconfig | sed -e "s:$p:...:" - read config from: .../.hgrc - .../.hgrc:13: alias.log=log -g - .../.hgrc:11: defaults.identify=-n - .../.hgrc:2: ui.debug=true - .../.hgrc:3: ui.fallbackencoding=ASCII - .../.hgrc:4: ui.quiet=true - .../.hgrc:5: ui.slash=true - .../.hgrc:6: ui.traceback=true - .../.hgrc:7: ui.verbose=true - .../.hgrc:8: ui.style=~/.hgstyle - .../.hgrc:9: ui.logtemplate={node} + $ hg showconfig + read config from: .*/.hgrc + .*/.hgrc:13: alias.log=log -g + .*/.hgrc:11: defaults.identify=-n + .*/.hgrc:2: ui.debug=true + .*/.hgrc:3: ui.fallbackencoding=ASCII + .*/.hgrc:4: ui.quiet=true + .*/.hgrc:5: ui.slash=true + .*/.hgrc:6: ui.traceback=true + .*/.hgrc:7: ui.verbose=true + .*/.hgrc:8: ui.style=~/.hgstyle + .*/.hgrc:9: ui.logtemplate={node} plain hgrc $ HGPLAIN=; export HGPLAIN - $ hg showconfig --config ui.traceback=True --debug | sed -e "s:$p:...:" - read config from: .../.hgrc + $ hg showconfig --config ui.traceback=True --debug + read config from: .*/.hgrc none: ui.traceback=True none: ui.verbose=False none: ui.debug=True diff --git a/tests/test-import.t b/tests/test-import.t --- a/tests/test-import.t +++ b/tests/test-import.t @@ -380,7 +380,8 @@ hg import in a subdirectory added 1 changesets with 2 changes to 2 files updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ hg --cwd a export tip | sed -e 's/d1\/d2\///' > tip.patch + $ hg --cwd a export tip > tmp + $ sed -e 's/d1\/d2\///' < tmp > tip.patch $ dir=`pwd` $ cd b/d1/d2 2>&1 > /dev/null $ hg import ../../../tip.patch diff --git a/tests/test-incoming-outgoing.t b/tests/test-incoming-outgoing.t --- a/tests/test-incoming-outgoing.t +++ b/tests/test-incoming-outgoing.t @@ -20,8 +20,8 @@ http incoming - $ hg -R new incoming http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/," - comparing with http://localhost:$HGPORT/ + $ hg -R new incoming http://localhost:$HGPORT/ + comparing with http://localhost:\d+/ changeset: 0:00a43fa82f62 user: test date: Thu Jan 01 00:00:00 1970 +0000 @@ -68,8 +68,8 @@ http incoming date: Thu Jan 01 00:00:00 1970 +0000 summary: 8 - $ hg -R new incoming -r 4 http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/," - comparing with http://localhost:$HGPORT/ + $ hg -R new incoming -r 4 http://localhost:$HGPORT/ + comparing with http://localhost:\d+/ changeset: 0:00a43fa82f62 user: test date: Thu Jan 01 00:00:00 1970 +0000 @@ -221,8 +221,8 @@ limit to 2 changesets, test with -p --gi test with --bundle - $ hg -R new incoming --bundle test.hg http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/," - comparing with http://localhost:$HGPORT/ + $ hg -R new incoming --bundle test.hg http://localhost:$HGPORT/ + comparing with http://localhost:.*/ changeset: 0:00a43fa82f62 user: test date: Thu Jan 01 00:00:00 1970 +0000 @@ -419,8 +419,8 @@ limit to 3 changesets date: Thu Jan 01 00:00:00 1970 +0000 summary: 11 - $ hg -R test-dev outgoing http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/," - comparing with http://localhost:$HGPORT/ + $ hg -R test-dev outgoing http://localhost:$HGPORT/ + comparing with http://localhost:.*/ searching for changes changeset: 9:d89d4abea5bc user: test @@ -448,8 +448,8 @@ limit to 3 changesets date: Thu Jan 01 00:00:00 1970 +0000 summary: 13 - $ hg -R test-dev outgoing -r 11 http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/," - comparing with http://localhost:$HGPORT/ + $ hg -R test-dev outgoing -r 11 http://localhost:$HGPORT/ + comparing with http://localhost:.*/ searching for changes changeset: 9:d89d4abea5bc user: test diff --git a/tests/test-mq-qdiff.t b/tests/test-mq-qdiff.t --- a/tests/test-mq-qdiff.t +++ b/tests/test-mq-qdiff.t @@ -17,10 +17,10 @@ qdiff: - $ hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" + $ hg qdiff diff -r d20a80d4def3 base --- a/base Thu Jan 01 00:00:00 1970 +0000 - +++ b/base + \+\+\+ b/base.* @@ -1,1 +1,1 @@ -base +patched diff --git a/tests/test-pull.t b/tests/test-pull.t --- a/tests/test-pull.t +++ b/tests/test-pull.t @@ -18,7 +18,7 @@ $ cat hg.pid >> $DAEMON_PIDS $ cd .. - $ hg clone --pull http://foo:bar@localhost:$HGPORT/ copy | sed -e "s,:$HGPORT/,:\$HGPORT/," + $ hg clone --pull http://foo:bar@localhost:$HGPORT/ copy requesting all changes adding changesets adding manifests @@ -43,13 +43,13 @@ $ hg manifest --debug 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 foo - $ hg pull | sed -e "s,:$HGPORT/,:\$HGPORT/," - pulling from http://foo:***@localhost:$HGPORT/ + $ hg pull + pulling from http://foo:\*\*\*@localhost:.*/ searching for changes no changes found - $ hg rollback --dry-run --verbose | sed -e "s,:$HGPORT/,:\$HGPORT/," - rolling back to revision -1 (undo pull: http://foo:***@localhost:$HGPORT/) + $ hg rollback --dry-run --verbose + rolling back to revision -1 \(undo pull: http://foo:\*\*\*@localhost:.*/\) Issue 622: diff --git a/tests/test-subrepo-svn.t b/tests/test-subrepo-svn.t --- a/tests/test-subrepo-svn.t +++ b/tests/test-subrepo-svn.t @@ -5,15 +5,12 @@ > tr '\\' / > } - $ escapedwd=`pwd | fix_path` - SVN wants all paths to start with a slash. Unfortunately, Windows ones don't. Handle that. + $ escapedwd=`pwd | fix_path` $ expr "$escapedwd" : / > /dev/null || escapedwd="/$escapedwd" $ escapedwd=`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$escapedwd"` - $ filterpath="s|$escapedwd|/root|" - $ filteroutofdate='s/ in transaction.*/ is out of date/;s/Out of date: /File /' create subversion repo @@ -74,19 +71,18 @@ add first svn sub with leading whitespac debugsub - $ hg debugsub | sed "$filterpath" + $ hg debugsub path s - source file:///root/svn-repo/src + source file:///.*/svn-repo/src revision 2 change file in svn and hg, commit $ echo a >> a $ echo alpha >> s/alpha - $ hg commit -m 'Message!' \ - > | sed 's:Sending.*s/alpha:Sending s/alpha:g' + $ hg commit -m 'Message!' committing subrepository s - Sending s/alpha + Sending.*s/alpha Transmitting file data . Committed revision 3. @@ -94,9 +90,9 @@ change file in svn and hg, commit External at revision 1. At revision 3. - $ hg debugsub | sed "$filterpath" + $ hg debugsub path s - source file:///root/svn-repo/src + source file:///.*/svn-repo/src revision 3 $ echo a > s/a @@ -128,20 +124,22 @@ add a commit from svn this commit from hg will fail $ echo zzz >> s/alpha - $ hg ci -m 'amend alpha from hg' 2>&1 | sed "$filteroutofdate" + $ hg ci -m 'amend alpha from hg' committing subrepository s abort: svn: Commit failed (details follow): - svn: File '/src/alpha' is out of date + svn: (Out of date)?.*/src/alpha.*(is out of date)? + [255] $ svn revert -q s/alpha this commit fails because of meta changes $ svn propset svn:mime-type 'text/html' s/alpha property 'svn:mime-type' set on 's/alpha' - $ hg ci -m 'amend alpha from hg' 2>&1 | sed "$filteroutofdate" + $ hg ci -m 'amend alpha from hg' committing subrepository s abort: svn: Commit failed (details follow): - svn: File '/src/alpha' is out of date + svn: (Out of date)?.*/src/alpha.*(is out of date)? + [255] $ svn revert -q s/alpha this commit fails because of externals changes @@ -192,9 +190,9 @@ clone debugsub in clone - $ hg debugsub | sed "$filterpath" + $ hg debugsub path s - source file:///root/svn-repo/src + source file:///.*/svn-repo/src revision 3 verify subrepo is contained within the repo directory diff --git a/tests/test-tags.t b/tests/test-tags.t --- a/tests/test-tags.t +++ b/tests/test-tags.t @@ -123,7 +123,7 @@ Add invalid tags: $ echo "spam" >> .hgtags $ echo >> .hgtags $ echo "foo bar" >> .hgtags - $ echo "$T invalid" | sed "s/..../a5a5/" >> .hg/localtags + $ echo "a5a5 invalid" >> .hg/localtags $ echo "committing .hgtags:" committing .hgtags: $ cat .hgtags