##// END OF EJS Templates
tests: drop a bunch of sed calls from unified tests
Matt Mackall -
r12366:c01dc908 default
parent child Browse files
Show More
@@ -72,6 +72,7 b' testfilters = ['
72 72
73 73 uprefix = r"^ \$ "
74 74 utestpats = [
75 (uprefix + r'.*\|\s*sed', "use regex test output patterns instead of sed"),
75 76 (uprefix + r'(true|exit 0)', "explicit zero exit unnecessary"),
76 77 (uprefix + r'.*\$\?', "explicit exit code checks unnecessary"),
77 78 (uprefix + r'.*\|\| echo.*(fail|error)',
@@ -74,23 +74,23 b' invalid arch type should give 404'
74 74 > % (os.environ['HGPORT'], node, archive))
75 75 > sys.stdout.write(f.read())
76 76 > EOF
77 $ python getarchive.py "$TIP" gz | gunzip | tar tf - 2>/dev/null | sed "s/$QTIP/TIP/"
78 test-archive-TIP/.hg_archival.txt
79 test-archive-TIP/bar
80 test-archive-TIP/baz/bletch
81 test-archive-TIP/foo
82 $ python getarchive.py "$TIP" bz2 | bunzip2 | tar tf - 2>/dev/null | sed "s/$QTIP/TIP/"
83 test-archive-TIP/.hg_archival.txt
84 test-archive-TIP/bar
85 test-archive-TIP/baz/bletch
86 test-archive-TIP/foo
77 $ python getarchive.py "$TIP" gz | gunzip | tar tf - 2>/dev/null
78 test-archive-2c0277f05ed4/.hg_archival.txt
79 test-archive-2c0277f05ed4/bar
80 test-archive-2c0277f05ed4/baz/bletch
81 test-archive-2c0277f05ed4/foo
82 $ python getarchive.py "$TIP" bz2 | bunzip2 | tar tf - 2>/dev/null
83 test-archive-2c0277f05ed4/.hg_archival.txt
84 test-archive-2c0277f05ed4/bar
85 test-archive-2c0277f05ed4/baz/bletch
86 test-archive-2c0277f05ed4/foo
87 87 $ python getarchive.py "$TIP" zip > archive.zip
88 $ unzip -t archive.zip | sed "s/$QTIP/TIP/"
88 $ unzip -t archive.zip
89 89 Archive: archive.zip
90 testing: test-archive-TIP/.hg_archival.txt OK
91 testing: test-archive-TIP/bar OK
92 testing: test-archive-TIP/baz/bletch OK
93 testing: test-archive-TIP/foo OK
90 testing: test-archive-2c0277f05ed4/.hg_archival.txt OK
91 testing: test-archive-2c0277f05ed4/bar OK
92 testing: test-archive-2c0277f05ed4/baz/bletch OK
93 testing: test-archive-2c0277f05ed4/foo OK
94 94 No errors detected in compressed data of archive.zip.
95 95
96 96 $ "$TESTDIR/killdaemons.py"
@@ -109,11 +109,11 b' invalid arch type should give 404'
109 109 test/foo
110 110
111 111 $ hg archive -t tgz -p %b-%h test-%h.tar.gz
112 $ gzip -dc test-$QTIP.tar.gz | tar tf - 2>/dev/null | sed "s/$QTIP/TIP/"
113 test-TIP/.hg_archival.txt
114 test-TIP/bar
115 test-TIP/baz/bletch
116 test-TIP/foo
112 $ gzip -dc test-$QTIP.tar.gz | tar tf - 2>/dev/null
113 test-2c0277f05ed4/.hg_archival.txt
114 test-2c0277f05ed4/bar
115 test-2c0277f05ed4/baz/bletch
116 test-2c0277f05ed4/foo
117 117
118 118 $ hg archive autodetected_test.tar
119 119 $ tar tf autodetected_test.tar
@@ -175,11 +175,11 b' archives and rename them afterwards.'
175 175 testing: test/foo OK
176 176 No errors detected in compressed data of test.zip.
177 177
178 $ hg archive -t tar - | tar tf - 2>/dev/null | sed "s/$QTIP/TIP/"
179 test-TIP/.hg_archival.txt
180 test-TIP/bar
181 test-TIP/baz/bletch
182 test-TIP/foo
178 $ hg archive -t tar - | tar tf - 2>/dev/null
179 test-2c0277f05ed4/.hg_archival.txt
180 test-2c0277f05ed4/bar
181 test-2c0277f05ed4/baz/bletch
182 test-2c0277f05ed4/foo
183 183
184 184 $ hg archive -r 0 -t tar rev-%r.tar
185 185 $ if [ -f rev-0.tar ]; then
@@ -277,6 +277,7 b' skip'
277 277 $ hg bisect -g tip
278 278 $ hg bisect -b tip
279 279 abort: starting revisions are not directly related
280 [255]
280 281
281 282 $ hg bisect -r
282 283 $ hg bisect -g null
@@ -349,6 +350,7 b' test no action'
349 350 $ hg bisect -r
350 351 $ hg bisect
351 352 abort: cannot bisect (no known good revisions)
353 [255]
352 354
353 355
354 356 reproduce AssertionError, issue1445
@@ -81,13 +81,13 b''
81 81 Exporting 4 changesets to a file:
82 82
83 83 $ hg export -o export_internal 1 2 3 4
84 $ grep HG export_internal | wc -l | sed -e 's/^ *//'
85 4
84 $ grep HG export_internal | wc -l
85 \s*4
86 86
87 87 Exporting 4 changesets to a file:
88 88
89 $ hg export 1 2 3 4 | grep HG | wc -l | sed -e 's/^ *//'
90 4
89 $ hg export 1 2 3 4 | grep HG | wc -l
90 \s*4
91 91
92 92 Exporting revision -2 to a file:
93 93
@@ -43,8 +43,9 b' Should display baz only:'
43 43 ? syntax
44 44
45 45 $ echo "*.o" > .hgignore
46 $ hg status 2>&1 | sed -e 's/abort: .*\.hgignore:/abort: .hgignore:/'
47 abort: .hgignore: invalid pattern (relre): *.o
46 $ hg status
47 abort: .*/.hgignore: invalid pattern \(relre\): \*.o
48 [255]
48 49
49 50 $ echo ".*\.o" > .hgignore
50 51 $ hg status
@@ -86,8 +87,8 b' Check it does not ignore the current dir'
86 87 ? syntax
87 88
88 89 $ echo "syntax: invalid" > .hgignore
89 $ hg status 2>&1 | sed -e 's/.*\.hgignore:/.hgignore:/'
90 .hgignore: ignoring invalid syntax 'invalid'
90 $ hg status
91 .*/.hgignore: ignoring invalid syntax 'invalid'
91 92 A dir/b.o
92 93 ? .hgignore
93 94 ? a.c
@@ -1,6 +1,7 b''
1 1 $ echo "invalid" > $HGRCPATH
2 $ hg version 2>&1 | sed -e "s|$HGRCPATH|\$HGRCPATH|"
3 hg: parse error at $HGRCPATH:1: invalid
2 $ hg version
3 hg: parse error at .*/\.hgrc:1: invalid
4 [255]
4 5 $ echo "" > $HGRCPATH
5 6
6 7 issue1199: escaping
@@ -11,22 +12,23 b' issue1199: escaping'
11 12 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
12 13 $ p=`pwd`
13 14 $ cd foobar
14 $ cat .hg/hgrc | sed -e "s:$p:...:"
15 $ cat .hg/hgrc
15 16 [paths]
16 default = .../foo%bar
17 $ hg paths | sed -e "s:$p:...:"
18 default = .../foo%bar
19 $ hg showconfig | sed -e "s:$p:...:"
20 bundle.mainreporoot=.../foobar
21 paths.default=.../foo%bar
17 default = .*/foo%bar
18 $ hg paths
19 default = .*/foo%bar
20 $ hg showconfig
21 bundle.mainreporoot=.*/foobar
22 paths.default=.*/foo%bar
22 23 $ cd ..
23 24
24 25 issue1829: wrong indentation
25 26
26 27 $ echo '[foo]' > $HGRCPATH
27 28 $ echo ' x = y' >> $HGRCPATH
28 $ hg version 2>&1 | sed -e "s|$HGRCPATH|\$HGRCPATH|"
29 hg: parse error at $HGRCPATH:2: x = y
29 $ hg version
30 hg: parse error at .*/\.hgrc:2: x = y
31 [255]
30 32
31 33 $ python -c "print '[foo]\nbar = a\n b\n c \n de\n fg \nbaz = bif cb \n'" \
32 34 > > $HGRCPATH
@@ -37,8 +39,9 b' issue1829: wrong indentation'
37 39 $ FAKEPATH=/path/to/nowhere
38 40 $ export FAKEPATH
39 41 $ echo '%include $FAKEPATH/no-such-file' > $HGRCPATH
40 $ hg version 2>&1 | sed -e "s|$HGRCPATH|\$HGRCPATH|"
41 hg: parse error at $HGRCPATH:1: cannot include /path/to/nowhere/no-such-file (No such file or directory)
42 $ hg version
43 hg: parse error at .*/.hgrc:1: cannot include /path/to/nowhere/no-such-file \(No such file or directory\)
44 [255]
42 45 $ unset FAKEPATH
43 46
44 47 username expansion
@@ -86,24 +89,24 b' HGPLAIN'
86 89
87 90 customized hgrc
88 91
89 $ hg showconfig | sed -e "s:$p:...:"
90 read config from: .../.hgrc
91 .../.hgrc:13: alias.log=log -g
92 .../.hgrc:11: defaults.identify=-n
93 .../.hgrc:2: ui.debug=true
94 .../.hgrc:3: ui.fallbackencoding=ASCII
95 .../.hgrc:4: ui.quiet=true
96 .../.hgrc:5: ui.slash=true
97 .../.hgrc:6: ui.traceback=true
98 .../.hgrc:7: ui.verbose=true
99 .../.hgrc:8: ui.style=~/.hgstyle
100 .../.hgrc:9: ui.logtemplate={node}
92 $ hg showconfig
93 read config from: .*/.hgrc
94 .*/.hgrc:13: alias.log=log -g
95 .*/.hgrc:11: defaults.identify=-n
96 .*/.hgrc:2: ui.debug=true
97 .*/.hgrc:3: ui.fallbackencoding=ASCII
98 .*/.hgrc:4: ui.quiet=true
99 .*/.hgrc:5: ui.slash=true
100 .*/.hgrc:6: ui.traceback=true
101 .*/.hgrc:7: ui.verbose=true
102 .*/.hgrc:8: ui.style=~/.hgstyle
103 .*/.hgrc:9: ui.logtemplate={node}
101 104
102 105 plain hgrc
103 106
104 107 $ HGPLAIN=; export HGPLAIN
105 $ hg showconfig --config ui.traceback=True --debug | sed -e "s:$p:...:"
106 read config from: .../.hgrc
108 $ hg showconfig --config ui.traceback=True --debug
109 read config from: .*/.hgrc
107 110 none: ui.traceback=True
108 111 none: ui.verbose=False
109 112 none: ui.debug=True
@@ -380,7 +380,8 b' hg import in a subdirectory'
380 380 added 1 changesets with 2 changes to 2 files
381 381 updating to branch default
382 382 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
383 $ hg --cwd a export tip | sed -e 's/d1\/d2\///' > tip.patch
383 $ hg --cwd a export tip > tmp
384 $ sed -e 's/d1\/d2\///' < tmp > tip.patch
384 385 $ dir=`pwd`
385 386 $ cd b/d1/d2 2>&1 > /dev/null
386 387 $ hg import ../../../tip.patch
@@ -20,8 +20,8 b''
20 20
21 21 http incoming
22 22
23 $ hg -R new incoming http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
24 comparing with http://localhost:$HGPORT/
23 $ hg -R new incoming http://localhost:$HGPORT/
24 comparing with http://localhost:\d+/
25 25 changeset: 0:00a43fa82f62
26 26 user: test
27 27 date: Thu Jan 01 00:00:00 1970 +0000
@@ -68,8 +68,8 b' http incoming'
68 68 date: Thu Jan 01 00:00:00 1970 +0000
69 69 summary: 8
70 70
71 $ hg -R new incoming -r 4 http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
72 comparing with http://localhost:$HGPORT/
71 $ hg -R new incoming -r 4 http://localhost:$HGPORT/
72 comparing with http://localhost:\d+/
73 73 changeset: 0:00a43fa82f62
74 74 user: test
75 75 date: Thu Jan 01 00:00:00 1970 +0000
@@ -221,8 +221,8 b' limit to 2 changesets, test with -p --gi'
221 221
222 222 test with --bundle
223 223
224 $ hg -R new incoming --bundle test.hg http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
225 comparing with http://localhost:$HGPORT/
224 $ hg -R new incoming --bundle test.hg http://localhost:$HGPORT/
225 comparing with http://localhost:.*/
226 226 changeset: 0:00a43fa82f62
227 227 user: test
228 228 date: Thu Jan 01 00:00:00 1970 +0000
@@ -419,8 +419,8 b' limit to 3 changesets'
419 419 date: Thu Jan 01 00:00:00 1970 +0000
420 420 summary: 11
421 421
422 $ hg -R test-dev outgoing http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
423 comparing with http://localhost:$HGPORT/
422 $ hg -R test-dev outgoing http://localhost:$HGPORT/
423 comparing with http://localhost:.*/
424 424 searching for changes
425 425 changeset: 9:d89d4abea5bc
426 426 user: test
@@ -448,8 +448,8 b' limit to 3 changesets'
448 448 date: Thu Jan 01 00:00:00 1970 +0000
449 449 summary: 13
450 450
451 $ hg -R test-dev outgoing -r 11 http://localhost:$HGPORT/ | sed -e "s,:$HGPORT/,:\$HGPORT/,"
452 comparing with http://localhost:$HGPORT/
451 $ hg -R test-dev outgoing -r 11 http://localhost:$HGPORT/
452 comparing with http://localhost:.*/
453 453 searching for changes
454 454 changeset: 9:d89d4abea5bc
455 455 user: test
@@ -17,10 +17,10 b''
17 17
18 18 qdiff:
19 19
20 $ hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/"
20 $ hg qdiff
21 21 diff -r d20a80d4def3 base
22 22 --- a/base Thu Jan 01 00:00:00 1970 +0000
23 +++ b/base
23 \+\+\+ b/base.*
24 24 @@ -1,1 +1,1 @@
25 25 -base
26 26 +patched
@@ -18,7 +18,7 b''
18 18 $ cat hg.pid >> $DAEMON_PIDS
19 19 $ cd ..
20 20
21 $ hg clone --pull http://foo:bar@localhost:$HGPORT/ copy | sed -e "s,:$HGPORT/,:\$HGPORT/,"
21 $ hg clone --pull http://foo:bar@localhost:$HGPORT/ copy
22 22 requesting all changes
23 23 adding changesets
24 24 adding manifests
@@ -43,13 +43,13 b''
43 43 $ hg manifest --debug
44 44 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 foo
45 45
46 $ hg pull | sed -e "s,:$HGPORT/,:\$HGPORT/,"
47 pulling from http://foo:***@localhost:$HGPORT/
46 $ hg pull
47 pulling from http://foo:\*\*\*@localhost:.*/
48 48 searching for changes
49 49 no changes found
50 50
51 $ hg rollback --dry-run --verbose | sed -e "s,:$HGPORT/,:\$HGPORT/,"
52 rolling back to revision -1 (undo pull: http://foo:***@localhost:$HGPORT/)
51 $ hg rollback --dry-run --verbose
52 rolling back to revision -1 \(undo pull: http://foo:\*\*\*@localhost:.*/\)
53 53
54 54 Issue 622:
55 55
@@ -5,15 +5,12 b''
5 5 > tr '\\' /
6 6 > }
7 7
8 $ escapedwd=`pwd | fix_path`
9
10 8 SVN wants all paths to start with a slash. Unfortunately, Windows ones
11 9 don't. Handle that.
12 10
11 $ escapedwd=`pwd | fix_path`
13 12 $ expr "$escapedwd" : / > /dev/null || escapedwd="/$escapedwd"
14 13 $ escapedwd=`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$escapedwd"`
15 $ filterpath="s|$escapedwd|/root|"
16 $ filteroutofdate='s/ in transaction.*/ is out of date/;s/Out of date: /File /'
17 14
18 15 create subversion repo
19 16
@@ -74,19 +71,18 b' add first svn sub with leading whitespac'
74 71
75 72 debugsub
76 73
77 $ hg debugsub | sed "$filterpath"
74 $ hg debugsub
78 75 path s
79 source file:///root/svn-repo/src
76 source file:///.*/svn-repo/src
80 77 revision 2
81 78
82 79 change file in svn and hg, commit
83 80
84 81 $ echo a >> a
85 82 $ echo alpha >> s/alpha
86 $ hg commit -m 'Message!' \
87 > | sed 's:Sending.*s/alpha:Sending s/alpha:g'
83 $ hg commit -m 'Message!'
88 84 committing subrepository s
89 Sending s/alpha
85 Sending.*s/alpha
90 86 Transmitting file data .
91 87 Committed revision 3.
92 88
@@ -94,9 +90,9 b' change file in svn and hg, commit'
94 90 External at revision 1.
95 91
96 92 At revision 3.
97 $ hg debugsub | sed "$filterpath"
93 $ hg debugsub
98 94 path s
99 source file:///root/svn-repo/src
95 source file:///.*/svn-repo/src
100 96 revision 3
101 97
102 98 $ echo a > s/a
@@ -128,20 +124,22 b' add a commit from svn'
128 124 this commit from hg will fail
129 125
130 126 $ echo zzz >> s/alpha
131 $ hg ci -m 'amend alpha from hg' 2>&1 | sed "$filteroutofdate"
127 $ hg ci -m 'amend alpha from hg'
132 128 committing subrepository s
133 129 abort: svn: Commit failed (details follow):
134 svn: File '/src/alpha' is out of date
130 svn: (Out of date)?.*/src/alpha.*(is out of date)?
131 [255]
135 132 $ svn revert -q s/alpha
136 133
137 134 this commit fails because of meta changes
138 135
139 136 $ svn propset svn:mime-type 'text/html' s/alpha
140 137 property 'svn:mime-type' set on 's/alpha'
141 $ hg ci -m 'amend alpha from hg' 2>&1 | sed "$filteroutofdate"
138 $ hg ci -m 'amend alpha from hg'
142 139 committing subrepository s
143 140 abort: svn: Commit failed (details follow):
144 svn: File '/src/alpha' is out of date
141 svn: (Out of date)?.*/src/alpha.*(is out of date)?
142 [255]
145 143 $ svn revert -q s/alpha
146 144
147 145 this commit fails because of externals changes
@@ -192,9 +190,9 b' clone'
192 190
193 191 debugsub in clone
194 192
195 $ hg debugsub | sed "$filterpath"
193 $ hg debugsub
196 194 path s
197 source file:///root/svn-repo/src
195 source file:///.*/svn-repo/src
198 196 revision 3
199 197
200 198 verify subrepo is contained within the repo directory
@@ -123,7 +123,7 b' Add invalid tags:'
123 123 $ echo "spam" >> .hgtags
124 124 $ echo >> .hgtags
125 125 $ echo "foo bar" >> .hgtags
126 $ echo "$T invalid" | sed "s/..../a5a5/" >> .hg/localtags
126 $ echo "a5a5 invalid" >> .hg/localtags
127 127 $ echo "committing .hgtags:"
128 128 committing .hgtags:
129 129 $ cat .hgtags
General Comments 0
You need to be logged in to leave comments. Login now