contrib/remote-helpers: style updates for test scripts

During the review of the main series it was noticed that these test scripts can use updates to conform to our coding style better, but fixing the style should be done in a patch separate from the main series. This updates the test-*.sh scripts only for style issues: * We do not leave SP between a redirection operator and the filename; * We change line before "then", "do", etc. rather than terminating the condition for "if"/"while" and list for "for" with a semicolon; * When HERE document does not use any expansion, we quote the end marker (e.g. "cat <<\EOF" not "cat <<EOF") to signal the readers that there is no funny substitution to worry about when reading the code. * We use "test" rather than "[". Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Aug 29, 2013 at 14:10 UTC ff867963f01ab9b5f1d27ef2e7b255fcb74281d5
4 files changed +248 -226
contrib/remote-helpers/test-bzr.sh
+57 -55
@@ -7,19 +7,21 @@ test_description='Test remote-bzr'
7
8 . ./test-lib.sh
9
10 -if ! test_have_prereq PYTHON; then
10 +if ! test_have_prereq PYTHON
11 +then
12 skip_all='skipping remote-bzr tests; python not available'
13 test_done
14 fi
15
15 -if ! python -c 'import bzrlib'; then
16 +if ! python -c 'import bzrlib'
17 +then
18 skip_all='skipping remote-bzr tests; bzr not available'
19 test_done
20 fi
21
22 check () {
21 - echo $3 > expected &&
22 - git --git-dir=$1/.git log --format='%s' -1 $2 > actual
23 + echo $3 >expected &&
24 + git --git-dir=$1/.git log --format='%s' -1 $2 >actual
25 test_cmp expected actual
26 }
27
@@ -29,7 +31,7 @@ test_expect_success 'cloning' '
31 (
32 bzr init bzrrepo &&
33 cd bzrrepo &&
32 - echo one > content &&
34 + echo one >content &&
35 bzr add content &&
36 bzr commit -m one
37 ) &&
@@ -41,7 +43,7 @@ test_expect_success 'cloning' '
43 test_expect_success 'pulling' '
44 (
45 cd bzrrepo &&
44 - echo two > content &&
46 + echo two >content &&
47 bzr commit -m two
48 ) &&
49
@@ -53,13 +55,13 @@ test_expect_success 'pulling' '
55 test_expect_success 'pushing' '
56 (
57 cd gitrepo &&
56 - echo three > content &&
58 + echo three >content &&
59 git commit -a -m three &&
60 git push
61 ) &&
62
61 - echo three > expected &&
62 - cat bzrrepo/content > actual &&
63 + echo three >expected &&
64 + cat bzrrepo/content >actual &&
65 test_cmp expected actual
66 '
67
@@ -67,16 +69,16 @@ test_expect_success 'roundtrip' '
69 (
70 cd gitrepo &&
71 git pull &&
70 - git log --format="%s" -1 origin/master > actual
72 + git log --format="%s" -1 origin/master >actual
73 ) &&
72 - echo three > expected &&
74 + echo three >expected &&
75 test_cmp expected actual &&
76
77 (cd gitrepo && git push && git pull) &&
78
79 (
80 cd bzrrepo &&
79 - echo four > content &&
81 + echo four >content &&
82 bzr commit -m four
83 ) &&
84
@@ -86,19 +88,19 @@ test_expect_success 'roundtrip' '
88
89 (
90 cd gitrepo &&
89 - echo five > content &&
91 + echo five >content &&
92 git commit -a -m five &&
93 git push && git pull
94 ) &&
95
96 (cd bzrrepo && bzr revert) &&
97
96 - echo five > expected &&
97 - cat bzrrepo/content > actual &&
98 + echo five >expected &&
99 + cat bzrrepo/content >actual &&
100 test_cmp expected actual
101 '
102
101 -cat > expected <<EOF
103 +cat >expected <<\EOF
104 100644 blob 54f9d6da5c91d556e6b54340b1327573073030af content
105 100755 blob 68769579c3eaadbe555379b9c3538e6628bae1eb executable
106 120000 blob 6b584e8ece562ebffc15d38808cd6b98fc3d97ea link
@@ -107,7 +109,7 @@ EOF
109 test_expect_success 'special modes' '
110 (
111 cd bzrrepo &&
110 - echo exec > executable
112 + echo exec >executable
113 chmod +x executable &&
114 bzr add executable
115 bzr commit -m exec &&
@@ -122,21 +124,21 @@ test_expect_success 'special modes' '
124 (
125 cd gitrepo &&
126 git pull
125 - git ls-tree HEAD > ../actual
127 + git ls-tree HEAD >../actual
128 ) &&
129
130 test_cmp expected actual &&
131
132 (
133 cd gitrepo &&
132 - git cat-file -p HEAD:link > ../actual
134 + git cat-file -p HEAD:link >../actual
135 ) &&
136
135 - printf content > expected &&
137 + printf content >expected &&
138 test_cmp expected actual
139 '
140
139 -cat > expected <<EOF
141 +cat >expected <<\EOF
142 100644 blob 54f9d6da5c91d556e6b54340b1327573073030af content
143 100755 blob 68769579c3eaadbe555379b9c3538e6628bae1eb executable
144 120000 blob 6b584e8ece562ebffc15d38808cd6b98fc3d97ea link
@@ -147,8 +149,8 @@ test_expect_success 'moving directory' '
149 (
150 cd bzrrepo &&
151 mkdir movedir &&
150 - echo one > movedir/one &&
151 - echo two > movedir/two &&
152 + echo one >movedir/one &&
153 + echo two >movedir/two &&
154 bzr add movedir &&
155 bzr commit -m movedir &&
156 bzr mv movedir movedir-new &&
@@ -158,7 +160,7 @@ test_expect_success 'moving directory' '
160 (
161 cd gitrepo &&
162 git pull &&
161 - git ls-tree HEAD > ../actual
163 + git ls-tree HEAD >../actual
164 ) &&
165
166 test_cmp expected actual
@@ -167,7 +169,7 @@ test_expect_success 'moving directory' '
169 test_expect_success 'different authors' '
170 (
171 cd bzrrepo &&
170 - echo john >> content &&
172 + echo john >>content &&
173 bzr commit -m john \
174 --author "Jane Rey <jrey@example.com>" \
175 --author "John Doe <jdoe@example.com>"
@@ -176,10 +178,10 @@ test_expect_success 'different authors' '
178 (
179 cd gitrepo &&
180 git pull &&
179 - git show --format="%an <%ae>, %cn <%ce>" --quiet > ../actual
181 + git show --format="%an <%ae>, %cn <%ce>" --quiet >../actual
182 ) &&
183
182 - echo "Jane Rey <jrey@example.com>, A U Thor <author@example.com>" > expected &&
184 + echo "Jane Rey <jrey@example.com>, A U Thor <author@example.com>" >expected &&
185 test_cmp expected actual
186 '
187
@@ -196,12 +198,12 @@ test_expect_success 'fetch utf-8 filenames' '
198 bzr init bzrrepo &&
199 cd bzrrepo &&
200
199 - echo test >> "ærø" &&
201 + echo test >>"ærø" &&
202 bzr add "ærø" &&
201 - echo test >> "ø~?" &&
203 + echo test >>"ø~?" &&
204 bzr add "ø~?" &&
205 bzr commit -m add-utf-8 &&
204 - echo test >> "ærø" &&
206 + echo test >>"ærø" &&
207 bzr commit -m test-utf-8 &&
208 bzr rm "ø~?" &&
209 bzr mv "ærø" "ø~?" &&
@@ -211,9 +213,9 @@ test_expect_success 'fetch utf-8 filenames' '
213 (
214 git clone "bzr::bzrrepo" gitrepo &&
215 cd gitrepo &&
214 - git -c core.quotepath=false ls-files > ../actual
216 + git -c core.quotepath=false ls-files >../actual
217 ) &&
216 - echo "ø~?" > expected &&
218 + echo "ø~?" >expected &&
219 test_cmp expected actual
220 '
221
@@ -229,7 +231,7 @@ test_expect_success 'push utf-8 filenames' '
231 bzr init bzrrepo &&
232 cd bzrrepo &&
233
232 - echo one >> content &&
234 + echo one >>content &&
235 bzr add content &&
236 bzr commit -m one
237 ) &&
@@ -238,15 +240,15 @@ test_expect_success 'push utf-8 filenames' '
240 git clone "bzr::bzrrepo" gitrepo &&
241 cd gitrepo &&
242
241 - echo test >> "ærø" &&
243 + echo test >>"ærø" &&
244 git add "ærø" &&
245 git commit -m utf-8 &&
246
247 git push
248 ) &&
249
248 - (cd bzrrepo && bzr ls > ../actual) &&
249 - printf "content\nærø\n" > expected &&
250 + (cd bzrrepo && bzr ls >../actual) &&
251 + printf "content\nærø\n" >expected &&
252 test_cmp expected actual
253 '
254
@@ -256,7 +258,7 @@ test_expect_success 'pushing a merge' '
258 (
259 bzr init bzrrepo &&
260 cd bzrrepo &&
259 - echo one > content &&
261 + echo one >content &&
262 bzr add content &&
263 bzr commit -m one
264 ) &&
@@ -265,27 +267,27 @@ test_expect_success 'pushing a merge' '
267
268 (
269 cd bzrrepo &&
268 - echo two > content &&
270 + echo two >content &&
271 bzr commit -m two
272 ) &&
273
274 (
275 cd gitrepo &&
274 - echo three > content &&
276 + echo three >content &&
277 git commit -a -m three &&
278 git fetch &&
279 git merge origin/master || true &&
278 - echo three > content &&
280 + echo three >content &&
281 git commit -a --no-edit &&
282 git push
283 ) &&
284
283 - echo three > expected &&
284 - cat bzrrepo/content > actual &&
285 + echo three >expected &&
286 + cat bzrrepo/content >actual &&
287 test_cmp expected actual
288 '
289
288 -cat > expected <<EOF
290 +cat >expected <<\EOF
291 origin/HEAD
292 origin/branch
293 origin/trunk
@@ -299,7 +301,7 @@ test_expect_success 'proper bzr repo' '
301 (
302 bzr init bzrrepo/trunk &&
303 cd bzrrepo/trunk &&
302 - echo one >> content &&
304 + echo one >>content &&
305 bzr add content &&
306 bzr commit -m one
307 ) &&
@@ -307,14 +309,14 @@ test_expect_success 'proper bzr repo' '
309 (
310 bzr branch bzrrepo/trunk bzrrepo/branch &&
311 cd bzrrepo/branch &&
310 - echo two >> content &&
312 + echo two >>content &&
313 bzr commit -m one
314 ) &&
315
316 (
317 git clone "bzr::bzrrepo" gitrepo &&
318 cd gitrepo &&
317 - git for-each-ref --format "%(refname:short)" refs/remotes/origin > ../actual
319 + git for-each-ref --format "%(refname:short)" refs/remotes/origin >../actual
320 ) &&
321
322 test_cmp expected actual
@@ -327,11 +329,11 @@ test_expect_success 'strip' '
329 bzr init bzrrepo &&
330 cd bzrrepo &&
331
330 - echo one >> content &&
332 + echo one >>content &&
333 bzr add content &&
334 bzr commit -m one &&
335
334 - echo two >> content &&
336 + echo two >>content &&
337 bzr commit -m two
338 ) &&
339
@@ -341,18 +343,18 @@ test_expect_success 'strip' '
343 cd bzrrepo &&
344 bzr uncommit --force &&
345
344 - echo three >> content &&
346 + echo three >>content &&
347 bzr commit -m three &&
348
347 - echo four >> content &&
349 + echo four >>content &&
350 bzr commit -m four &&
349 - bzr log --line | sed -e "s/^[0-9][0-9]*: //" > ../expected
351 + bzr log --line | sed -e "s/^[0-9][0-9]*: //" >../expected
352 ) &&
353
354 (
355 cd gitrepo &&
356 git fetch &&
355 - git log --format="%an %ad %s" --date=short origin/master > ../actual
357 + git log --format="%an %ad %s" --date=short origin/master >../actual
358 ) &&
359
360 test_cmp expected actual
@@ -372,7 +374,7 @@ test_expect_success 'export utf-8 authors' '
374 (
375 git init gitrepo &&
376 cd gitrepo &&
375 - echo greg >> content &&
377 + echo greg >>content &&
378 git add content &&
379 git commit -m one &&
380 git remote add bzr "bzr::../bzrrepo" &&
@@ -381,10 +383,10 @@ test_expect_success 'export utf-8 authors' '
383
384 (
385 cd bzrrepo &&
384 - bzr log | grep "^committer: " > ../actual
386 + bzr log | grep "^committer: " >../actual
387 ) &&
388
387 - echo "committer: Grégoire <committer@example.com>" > expected &&
389 + echo "committer: Grégoire <committer@example.com>" >expected &&
390 test_cmp expected actual
391 '
392
contrib/remote-helpers/test-hg-bidi.sh
+27 -25
@@ -10,12 +10,14 @@ test_description='Test bidirectionality of remote-hg'
10
11 . ./test-lib.sh
12
13 -if ! test_have_prereq PYTHON; then
13 +if ! test_have_prereq PYTHON
14 +then
15 skip_all='skipping remote-hg tests; python not available'
16 test_done
17 fi
18
18 -if ! python -c 'import mercurial'; then
19 +if ! python -c 'import mercurial'
20 +then
21 skip_all='skipping remote-hg tests; mercurial not available'
22 test_done
23 fi
@@ -43,7 +45,7 @@ hg_push () {
45 git checkout -q -b tmp &&
46 git fetch -q "hg::../$1" 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*' &&
47 git checkout -q @{-1} &&
46 - git branch -q -D tmp 2> /dev/null || true
48 + git branch -q -D tmp 2>/dev/null || true
49 )
50 }
51
@@ -62,7 +64,7 @@ setup () {
64 echo "tag = -d \"0 0\""
65 echo "[extensions]"
66 echo "graphlog ="
65 - ) >> "$HOME"/.hgrc &&
67 + ) >>"$HOME"/.hgrc &&
68 git config --global remote-hg.hg-git-compat true
69 git config --global remote-hg.track-branches true
70
@@ -81,22 +83,22 @@ test_expect_success 'encoding' '
83 git init -q gitrepo &&
84 cd gitrepo &&
85
84 - echo alpha > alpha &&
86 + echo alpha >alpha &&
87 git add alpha &&
88 git commit -m "add älphà" &&
89
90 GIT_AUTHOR_NAME="tést èncödîng" &&
91 export GIT_AUTHOR_NAME &&
90 - echo beta > beta &&
92 + echo beta >beta &&
93 git add beta &&
94 git commit -m "add beta" &&
95
94 - echo gamma > gamma &&
96 + echo gamma >gamma &&
97 git add gamma &&
98 git commit -m "add gämmâ" &&
99
100 : TODO git config i18n.commitencoding latin-1 &&
99 - echo delta > delta &&
101 + echo delta >delta &&
102 git add delta &&
103 git commit -m "add déltà"
104 ) &&
@@ -105,8 +107,8 @@ test_expect_success 'encoding' '
107 git_clone hgrepo gitrepo2 &&
108 hg_clone gitrepo2 hgrepo2 &&
109
108 - HGENCODING=utf-8 hg_log hgrepo > expected &&
109 - HGENCODING=utf-8 hg_log hgrepo2 > actual &&
110 + HGENCODING=utf-8 hg_log hgrepo >expected &&
111 + HGENCODING=utf-8 hg_log hgrepo2 >actual &&
112
113 test_cmp expected actual
114 '
@@ -117,14 +119,14 @@ test_expect_success 'file removal' '
119 (
120 git init -q gitrepo &&
121 cd gitrepo &&
120 - echo alpha > alpha &&
122 + echo alpha >alpha &&
123 git add alpha &&
124 git commit -m "add alpha" &&
123 - echo beta > beta &&
125 + echo beta >beta &&
126 git add beta &&
127 git commit -m "add beta"
128 mkdir foo &&
127 - echo blah > foo/bar &&
129 + echo blah >foo/bar &&
130 git add foo &&
131 git commit -m "add foo" &&
132 git rm alpha &&
@@ -137,8 +139,8 @@ test_expect_success 'file removal' '
139 git_clone hgrepo gitrepo2 &&
140 hg_clone gitrepo2 hgrepo2 &&
141
140 - hg_log hgrepo > expected &&
141 - hg_log hgrepo2 > actual &&
142 + hg_log hgrepo >expected &&
143 + hg_log hgrepo2 >actual &&
144
145 test_cmp expected actual
146 '
@@ -150,12 +152,12 @@ test_expect_success 'git tags' '
152 git init -q gitrepo &&
153 cd gitrepo &&
154 git config receive.denyCurrentBranch ignore &&
153 - echo alpha > alpha &&
155 + echo alpha >alpha &&
156 git add alpha &&
157 git commit -m "add alpha" &&
158 git tag alpha &&
159
158 - echo beta > beta &&
160 + echo beta >beta &&
161 git add beta &&
162 git commit -m "add beta" &&
163 git tag -a -m "added tag beta" beta
@@ -165,8 +167,8 @@ test_expect_success 'git tags' '
167 git_clone hgrepo gitrepo2 &&
168 hg_clone gitrepo2 hgrepo2 &&
169
168 - hg_log hgrepo > expected &&
169 - hg_log hgrepo2 > actual &&
170 + hg_log hgrepo >expected &&
171 + hg_log hgrepo2 >actual &&
172
173 test_cmp expected actual
174 '
@@ -178,7 +180,7 @@ test_expect_success 'hg branch' '
180 git init -q gitrepo &&
181 cd gitrepo &&
182
181 - echo alpha > alpha &&
183 + echo alpha >alpha &&
184 git add alpha &&
185 git commit -q -m "add alpha" &&
186 git checkout -q -b not-master
@@ -201,8 +203,8 @@ test_expect_success 'hg branch' '
203 : Back to the common revision &&
204 (cd hgrepo && hg checkout default) &&
205
204 - hg_log hgrepo > expected &&
205 - hg_log hgrepo2 > actual &&
206 + hg_log hgrepo >expected &&
207 + hg_log hgrepo2 >actual &&
208
209 test_cmp expected actual
210 '
@@ -214,7 +216,7 @@ test_expect_success 'hg tags' '
216 git init -q gitrepo &&
217 cd gitrepo &&
218
217 - echo alpha > alpha &&
219 + echo alpha >alpha &&
220 git add alpha &&
221 git commit -m "add alpha" &&
222 git checkout -q -b not-master
@@ -231,8 +233,8 @@ test_expect_success 'hg tags' '
233 hg_push hgrepo gitrepo &&
234 hg_clone gitrepo hgrepo2 &&
235
234 - hg_log hgrepo > expected &&
235 - hg_log hgrepo2 > actual &&
236 + hg_log hgrepo >expected &&
237 + hg_log hgrepo2 >actual &&
238
239 test_cmp expected actual
240 '
contrib/remote-helpers/test-hg-hg-git.sh
+85 -71
@@ -10,17 +10,20 @@ test_description='Test remote-hg output compared to hg-git'
10
11 . ./test-lib.sh
12
13 -if ! test_have_prereq PYTHON; then
13 +if ! test_have_prereq PYTHON
14 +then
15 skip_all='skipping remote-hg tests; python not available'
16 test_done
17 fi
18
18 -if ! python -c 'import mercurial'; then
19 +if ! python -c 'import mercurial'
20 +then
21 skip_all='skipping remote-hg tests; mercurial not available'
22 test_done
23 fi
24
23 -if ! python -c 'import hggit'; then
25 +if ! python -c 'import hggit'
26 +then
27 skip_all='skipping remote-hg tests; hg-git not available'
28 test_done
29 fi
@@ -66,7 +69,7 @@ hg_push_git () {
69 git fetch -q "hg::../$1" 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*' &&
70 git branch -D default &&
71 git checkout -q @{-1} &&
69 - git branch -q -D tmp 2> /dev/null || true
72 + git branch -q -D tmp 2>/dev/null || true
73 )
74 }
75
@@ -100,7 +103,7 @@ setup () {
103 echo "hgext.bookmarks ="
104 echo "hggit ="
105 echo "graphlog ="
103 - ) >> "$HOME"/.hgrc &&
106 + ) >>"$HOME"/.hgrc &&
107 git config --global receive.denycurrentbranch warn
108 git config --global remote-hg.hg-git-compat true
109 git config --global remote-hg.track-branches false
@@ -121,7 +124,7 @@ test_expect_success 'executable bit' '
124 (
125 git init -q gitrepo &&
126 cd gitrepo &&
124 - echo alpha > alpha &&
127 + echo alpha >alpha &&
128 chmod 0644 alpha &&
129 git add alpha &&
130 git commit -m "add alpha" &&
@@ -133,17 +136,18 @@ test_expect_success 'executable bit' '
136 git commit -m "clear executable bit"
137 ) &&
138
136 - for x in hg git; do
139 + for x in hg git
140 + do
141 (
142 hg_clone_$x gitrepo hgrepo-$x &&
143 cd hgrepo-$x &&
144 hg_log . &&
145 hg manifest -r 1 -v &&
146 hg manifest -v
143 - ) > output-$x &&
147 + ) >output-$x &&
148
149 git_clone_$x hgrepo-$x gitrepo2-$x &&
146 - git_log gitrepo2-$x > log-$x
150 + git_log gitrepo2-$x >log-$x
151 done &&
152
153 test_cmp output-hg output-git &&
@@ -156,7 +160,7 @@ test_expect_success 'symlink' '
160 (
161 git init -q gitrepo &&
162 cd gitrepo &&
159 - echo alpha > alpha &&
163 + echo alpha >alpha &&
164 git add alpha &&
165 git commit -m "add alpha" &&
166 ln -s alpha beta &&
@@ -164,16 +168,17 @@ test_expect_success 'symlink' '
168 git commit -m "add beta"
169 ) &&
170
167 - for x in hg git; do
171 + for x in hg git
172 + do
173 (
174 hg_clone_$x gitrepo hgrepo-$x &&
175 cd hgrepo-$x &&
176 hg_log . &&
177 hg manifest -v
173 - ) > output-$x &&
178 + ) >output-$x &&
179
180 git_clone_$x hgrepo-$x gitrepo2-$x &&
176 - git_log gitrepo2-$x > log-$x
181 + git_log gitrepo2-$x >log-$x
182 done &&
183
184 test_cmp output-hg output-git &&
@@ -186,28 +191,29 @@ test_expect_success 'merge conflict 1' '
191 (
192 hg init hgrepo1 &&
193 cd hgrepo1 &&
189 - echo A > afile &&
194 + echo A >afile &&
195 hg add afile &&
196 hg ci -m "origin" &&
197
193 - echo B > afile &&
198 + echo B >afile &&
199 hg ci -m "A->B" &&
200
201 hg up -r0 &&
197 - echo C > afile &&
202 + echo C >afile &&
203 hg ci -m "A->C" &&
204
205 hg merge -r1 &&
201 - echo C > afile &&
206 + echo C >afile &&
207 hg resolve -m afile &&
208 hg ci -m "merge to C"
209 ) &&
210
206 - for x in hg git; do
211 + for x in hg git
212 + do
213 git_clone_$x hgrepo1 gitrepo-$x &&
214 hg_clone_$x gitrepo-$x hgrepo2-$x &&
209 - hg_log hgrepo2-$x > hg-log-$x &&
210 - git_log gitrepo-$x > git-log-$x
215 + hg_log hgrepo2-$x >hg-log-$x &&
216 + git_log gitrepo-$x >git-log-$x
217 done &&
218
219 test_cmp hg-log-hg hg-log-git &&
@@ -220,28 +226,29 @@ test_expect_success 'merge conflict 2' '
226 (
227 hg init hgrepo1 &&
228 cd hgrepo1 &&
223 - echo A > afile &&
229 + echo A >afile &&
230 hg add afile &&
231 hg ci -m "origin" &&
232
227 - echo B > afile &&
233 + echo B >afile &&
234 hg ci -m "A->B" &&
235
236 hg up -r0 &&
231 - echo C > afile &&
237 + echo C >afile &&
238 hg ci -m "A->C" &&
239
240 hg merge -r1 || true &&
235 - echo B > afile &&
241 + echo B >afile &&
242 hg resolve -m afile &&
243 hg ci -m "merge to B"
244 ) &&
245
240 - for x in hg git; do
246 + for x in hg git
247 + do
248 git_clone_$x hgrepo1 gitrepo-$x &&
249 hg_clone_$x gitrepo-$x hgrepo2-$x &&
243 - hg_log hgrepo2-$x > hg-log-$x &&
244 - git_log gitrepo-$x > git-log-$x
250 + hg_log hgrepo2-$x >hg-log-$x &&
251 + git_log gitrepo-$x >git-log-$x
252 done &&
253
254 test_cmp hg-log-hg hg-log-git &&
@@ -254,29 +261,30 @@ test_expect_success 'converged merge' '
261 (
262 hg init hgrepo1 &&
263 cd hgrepo1 &&
257 - echo A > afile &&
264 + echo A >afile &&
265 hg add afile &&
266 hg ci -m "origin" &&
267
261 - echo B > afile &&
268 + echo B >afile &&
269 hg ci -m "A->B" &&
270
264 - echo C > afile &&
271 + echo C >afile &&
272 hg ci -m "B->C" &&
273
274 hg up -r0 &&
268 - echo C > afile &&
275 + echo C >afile &&
276 hg ci -m "A->C" &&
277
278 hg merge -r2 || true &&
279 hg ci -m "merge"
280 ) &&
281
275 - for x in hg git; do
282 + for x in hg git
283 + do
284 git_clone_$x hgrepo1 gitrepo-$x &&
285 hg_clone_$x gitrepo-$x hgrepo2-$x &&
278 - hg_log hgrepo2-$x > hg-log-$x &&
279 - git_log gitrepo-$x > git-log-$x
286 + hg_log hgrepo2-$x >hg-log-$x &&
287 + git_log gitrepo-$x >git-log-$x
288 done &&
289
290 test_cmp hg-log-hg hg-log-git &&
@@ -290,32 +298,33 @@ test_expect_success 'encoding' '
298 git init -q gitrepo &&
299 cd gitrepo &&
300
293 - echo alpha > alpha &&
301 + echo alpha >alpha &&
302 git add alpha &&
303 git commit -m "add älphà" &&
304
305 GIT_AUTHOR_NAME="tést èncödîng" &&
306 export GIT_AUTHOR_NAME &&
299 - echo beta > beta &&
307 + echo beta >beta &&
308 git add beta &&
309 git commit -m "add beta" &&
310
303 - echo gamma > gamma &&
311 + echo gamma >gamma &&
312 git add gamma &&
313 git commit -m "add gämmâ" &&
314
315 : TODO git config i18n.commitencoding latin-1 &&
308 - echo delta > delta &&
316 + echo delta >delta &&
317 git add delta &&
318 git commit -m "add déltà"
319 ) &&
320
313 - for x in hg git; do
321 + for x in hg git
322 + do
323 hg_clone_$x gitrepo hgrepo-$x &&
324 git_clone_$x hgrepo-$x gitrepo2-$x &&
325
317 - HGENCODING=utf-8 hg_log hgrepo-$x > hg-log-$x &&
318 - git_log gitrepo2-$x > git-log-$x
326 + HGENCODING=utf-8 hg_log hgrepo-$x >hg-log-$x &&
327 + git_log gitrepo2-$x >git-log-$x
328 done &&
329
330 test_cmp hg-log-hg hg-log-git &&
@@ -328,14 +337,14 @@ test_expect_success 'file removal' '
337 (
338 git init -q gitrepo &&
339 cd gitrepo &&
331 - echo alpha > alpha &&
340 + echo alpha >alpha &&
341 git add alpha &&
342 git commit -m "add alpha" &&
334 - echo beta > beta &&
343 + echo beta >beta &&
344 git add beta &&
345 git commit -m "add beta"
346 mkdir foo &&
338 - echo blah > foo/bar &&
347 + echo blah >foo/bar &&
348 git add foo &&
349 git commit -m "add foo" &&
350 git rm alpha &&
@@ -344,17 +353,18 @@ test_expect_success 'file removal' '
353 git commit -m "remove foo/bar"
354 ) &&
355
347 - for x in hg git; do
356 + for x in hg git
357 + do
358 (
359 hg_clone_$x gitrepo hgrepo-$x &&
360 cd hgrepo-$x &&
361 hg_log . &&
362 hg manifest -r 3 &&
363 hg manifest
354 - ) > output-$x &&
364 + ) >output-$x &&
365
366 git_clone_$x hgrepo-$x gitrepo2-$x &&
357 - git_log gitrepo2-$x > log-$x
367 + git_log gitrepo2-$x >log-$x
368 done &&
369
370 test_cmp output-hg output-git &&
@@ -368,20 +378,21 @@ test_expect_success 'git tags' '
378 git init -q gitrepo &&
379 cd gitrepo &&
380 git config receive.denyCurrentBranch ignore &&
371 - echo alpha > alpha &&
381 + echo alpha >alpha &&
382 git add alpha &&
383 git commit -m "add alpha" &&
384 git tag alpha &&
385
376 - echo beta > beta &&
386 + echo beta >beta &&
387 git add beta &&
388 git commit -m "add beta" &&
389 git tag -a -m "added tag beta" beta
390 ) &&
391
382 - for x in hg git; do
392 + for x in hg git
393 + do
394 hg_clone_$x gitrepo hgrepo-$x &&
384 - hg_log hgrepo-$x > log-$x
395 + hg_log hgrepo-$x >log-$x
396 done &&
397
398 test_cmp log-hg log-git
@@ -390,12 +401,13 @@ test_expect_success 'git tags' '
401 test_expect_success 'hg author' '
402 test_when_finished "rm -rf gitrepo* hgrepo*" &&
403
393 - for x in hg git; do
404 + for x in hg git
405 + do
406 (
407 git init -q gitrepo-$x &&
408 cd gitrepo-$x &&
409
398 - echo alpha > alpha &&
410 + echo alpha >alpha &&
411 git add alpha &&
412 git commit -m "add alpha" &&
413 git checkout -q -b not-master
@@ -406,38 +418,38 @@ test_expect_success 'hg author' '
418 cd hgrepo-$x &&
419
420 hg co master &&
409 - echo beta > beta &&
421 + echo beta >beta &&
422 hg add beta &&
423 hg commit -u "test" -m "add beta" &&
424
413 - echo gamma >> beta &&
425 + echo gamma >>beta &&
426 hg commit -u "test <test@example.com> (comment)" -m "modify beta" &&
427
416 - echo gamma > gamma &&
428 + echo gamma >gamma &&
429 hg add gamma &&
430 hg commit -u "<test@example.com>" -m "add gamma" &&
431
420 - echo delta > delta &&
432 + echo delta >delta &&
433 hg add delta &&
434 hg commit -u "name<test@example.com>" -m "add delta" &&
435
424 - echo epsilon > epsilon &&
436 + echo epsilon >epsilon &&
437 hg add epsilon &&
438 hg commit -u "name <test@example.com" -m "add epsilon" &&
439
428 - echo zeta > zeta &&
440 + echo zeta >zeta &&
441 hg add zeta &&
442 hg commit -u " test " -m "add zeta" &&
443
432 - echo eta > eta &&
444 + echo eta >eta &&
445 hg add eta &&
446 hg commit -u "test < test@example.com >" -m "add eta" &&
447
436 - echo theta > theta &&
448 + echo theta >theta &&
449 hg add theta &&
450 hg commit -u "test >test@example.com>" -m "add theta" &&
451
440 - echo iota > iota &&
452 + echo iota >iota &&
453 hg add iota &&
454 hg commit -u "test <test <at> example <dot> com>" -m "add iota"
455 ) &&
@@ -445,8 +457,8 @@ test_expect_success 'hg author' '
457 hg_push_$x hgrepo-$x gitrepo-$x &&
458 hg_clone_$x gitrepo-$x hgrepo2-$x &&
459
448 - hg_log hgrepo2-$x > hg-log-$x &&
449 - git_log gitrepo-$x > git-log-$x
460 + hg_log hgrepo2-$x >hg-log-$x &&
461 + git_log gitrepo-$x >git-log-$x
462 done &&
463
464 test_cmp hg-log-hg hg-log-git &&
@@ -456,12 +468,13 @@ test_expect_success 'hg author' '
468 test_expect_success 'hg branch' '
469 test_when_finished "rm -rf gitrepo* hgrepo*" &&
470
459 - for x in hg git; do
471 + for x in hg git
472 + do
473 (
474 git init -q gitrepo-$x &&
475 cd gitrepo-$x &&
476
464 - echo alpha > alpha &&
477 + echo alpha >alpha &&
478 git add alpha &&
479 git commit -q -m "add alpha" &&
480 git checkout -q -b not-master
@@ -481,8 +494,8 @@ test_expect_success 'hg branch' '
494 hg_push_$x hgrepo-$x gitrepo-$x &&
495 hg_clone_$x gitrepo-$x hgrepo2-$x &&
496
484 - hg_log hgrepo2-$x > hg-log-$x &&
485 - git_log gitrepo-$x > git-log-$x
497 + hg_log hgrepo2-$x >hg-log-$x &&
498 + git_log gitrepo-$x >git-log-$x
499 done &&
500
501 test_cmp hg-log-hg hg-log-git &&
@@ -492,12 +505,13 @@ test_expect_success 'hg branch' '
505 test_expect_success 'hg tags' '
506 test_when_finished "rm -rf gitrepo* hgrepo*" &&
507
495 - for x in hg git; do
508 + for x in hg git
509 + do
510 (
511 git init -q gitrepo-$x &&
512 cd gitrepo-$x &&
513
500 - echo alpha > alpha &&
514 + echo alpha >alpha &&
515 git add alpha &&
516 git commit -m "add alpha" &&
517 git checkout -q -b not-master
@@ -518,7 +532,7 @@ test_expect_success 'hg tags' '
532 git --git-dir=gitrepo-$x/.git tag -l &&
533 hg_log hgrepo2-$x &&
534 cat hgrepo2-$x/.hgtags
521 - ) > output-$x
535 + ) >output-$x
536 done &&
537
538 test_cmp output-hg output-git
contrib/remote-helpers/test-hg.sh
+79 -75
@@ -10,40 +10,44 @@ test_description='Test remote-hg'
10
11 . ./test-lib.sh
12
13 -if ! test_have_prereq PYTHON; then
13 +if ! test_have_prereq PYTHON
14 +then
15 skip_all='skipping remote-hg tests; python not available'
16 test_done
17 fi
18
18 -if ! python -c 'import mercurial'; then
19 +if ! python -c 'import mercurial'
20 +then
21 skip_all='skipping remote-hg tests; mercurial not available'
22 test_done
23 fi
24
25 check () {
24 - echo $3 > expected &&
25 - git --git-dir=$1/.git log --format='%s' -1 $2 > actual
26 + echo $3 >expected &&
27 + git --git-dir=$1/.git log --format='%s' -1 $2 >actual
28 test_cmp expected actual
29 }
30
31 check_branch () {
30 - if [ -n "$3" ]; then
31 - echo $3 > expected &&
32 - hg -R $1 log -r $2 --template '{desc}\n' > actual &&
32 + if test -n "$3"
33 + then
34 + echo $3 >expected &&
35 + hg -R $1 log -r $2 --template '{desc}\n' >actual &&
36 test_cmp expected actual
37 else
35 - hg -R $1 branches > out &&
38 + hg -R $1 branches >out &&
39 ! grep $2 out
40 fi
41 }
42
43 check_bookmark () {
41 - if [ -n "$3" ]; then
42 - echo $3 > expected &&
43 - hg -R $1 log -r "bookmark('$2')" --template '{desc}\n' > actual &&
44 + if test -n "$3"
45 + then
46 + echo $3 >expected &&
47 + hg -R $1 log -r "bookmark('$2')" --template '{desc}\n' >actual &&
48 test_cmp expected actual
49 else
46 - hg -R $1 bookmarks > out &&
50 + hg -R $1 bookmarks >out &&
51 ! grep $2 out
52 fi
53 }
@@ -52,7 +56,7 @@ check_push () {
56 local expected_ret=$1 ret=0 ref_ret=0 IFS=':'
57
58 shift
55 - git push origin "$@" 2> error
59 + git push origin "$@" 2>error
60 ret=$?
61 cat error
62
@@ -92,7 +96,7 @@ setup () {
96 echo "username = H G Wells <wells@example.com>"
97 echo "[extensions]"
98 echo "mq ="
95 - ) >> "$HOME"/.hgrc &&
99 + ) >>"$HOME"/.hgrc &&
100
101 GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0230" &&
102 GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" &&
@@ -107,7 +111,7 @@ test_expect_success 'cloning' '
111 (
112 hg init hgrepo &&
113 cd hgrepo &&
110 - echo zero > content &&
114 + echo zero >content &&
115 hg add content &&
116 hg commit -m zero
117 ) &&
@@ -122,7 +126,7 @@ test_expect_success 'cloning with branches' '
126 (
127 cd hgrepo &&
128 hg branch next &&
125 - echo next > content &&
129 + echo next >content &&
130 hg commit -m next
131 ) &&
132
@@ -137,7 +141,7 @@ test_expect_success 'cloning with bookmarks' '
141 cd hgrepo &&
142 hg checkout default &&
143 hg bookmark feature-a &&
140 - echo feature-a > content &&
144 + echo feature-a >content &&
145 hg commit -m feature-a
146 ) &&
147
@@ -157,7 +161,7 @@ test_expect_success 'update bookmark' '
161 git clone "hg::hgrepo" gitrepo &&
162 cd gitrepo &&
163 git checkout --quiet devel &&
160 - echo devel > content &&
164 + echo devel >content &&
165 git commit -a -m devel &&
166 git push --quiet
167 ) &&
@@ -172,7 +176,7 @@ test_expect_success 'new bookmark' '
176 git clone "hg::hgrepo" gitrepo &&
177 cd gitrepo &&
178 git checkout --quiet -b feature-b &&
175 - echo feature-b > content &&
179 + echo feature-b >content &&
180 git commit -a -m feature-b &&
181 git push --quiet origin feature-b
182 ) &&
@@ -184,9 +188,9 @@ test_expect_success 'new bookmark' '
188 rm -rf hgrepo
189
190 author_test () {
187 - echo $1 >> content &&
191 + echo $1 >>content &&
192 hg commit -u "$2" -m "add $1" &&
189 - echo "$3" >> ../expected
193 + echo "$3" >>../expected
194 }
195
196 test_expect_success 'authors' '
@@ -199,7 +203,7 @@ test_expect_success 'authors' '
203 touch content &&
204 hg add content &&
205
202 - > ../expected &&
206 + >../expected &&
207 author_test alpha "" "H G Wells <wells@example.com>" &&
208 author_test beta "test" "test <unknown>" &&
209 author_test beta "test <test@example.com> (comment)" "test <test@example.com>" &&
@@ -214,7 +218,7 @@ test_expect_success 'authors' '
218 ) &&
219
220 git clone "hg::hgrepo" gitrepo &&
217 - git --git-dir=gitrepo/.git log --reverse --format="%an <%ae>" > actual &&
221 + git --git-dir=gitrepo/.git log --reverse --format="%an <%ae>" >actual &&
222
223 test_cmp expected actual
224 '
@@ -226,11 +230,11 @@ test_expect_success 'strip' '
230 hg init hgrepo &&
231 cd hgrepo &&
232
229 - echo one >> content &&
233 + echo one >>content &&
234 hg add content &&
235 hg commit -m one &&
236
233 - echo two >> content &&
237 + echo two >>content &&
238 hg commit -m two
239 ) &&
240
@@ -240,20 +244,20 @@ test_expect_success 'strip' '
244 cd hgrepo &&
245 hg strip 1 &&
246
243 - echo three >> content &&
247 + echo three >>content &&
248 hg commit -m three &&
249
246 - echo four >> content &&
250 + echo four >>content &&
251 hg commit -m four
252 ) &&
253
254 (
255 cd gitrepo &&
256 git fetch &&
253 - git log --format="%s" origin/master > ../actual
257 + git log --format="%s" origin/master >../actual
258 ) &&
259
256 - hg -R hgrepo log --template "{desc}\n" > expected &&
260 + hg -R hgrepo log --template "{desc}\n" >expected &&
261 test_cmp actual expected
262 '
263
@@ -263,18 +267,18 @@ test_expect_success 'remote push with master bookmark' '
267 (
268 hg init hgrepo &&
269 cd hgrepo &&
266 - echo zero > content &&
270 + echo zero >content &&
271 hg add content &&
272 hg commit -m zero &&
273 hg bookmark master &&
270 - echo one > content &&
274 + echo one >content &&
275 hg commit -m one
276 ) &&
277
278 (
279 git clone "hg::hgrepo" gitrepo &&
280 cd gitrepo &&
277 - echo two > content &&
281 + echo two >content &&
282 git commit -a -m two &&
283 git push
284 ) &&
@@ -282,7 +286,7 @@ test_expect_success 'remote push with master bookmark' '
286 check_branch hgrepo default two
287 '
288
285 -cat > expected <<EOF
289 +cat >expected <<\EOF
290 changeset: 0:6e2126489d3d
291 tag: tip
292 user: A U Thor <author@example.com>
@@ -300,13 +304,13 @@ test_expect_success 'remote push from master branch' '
304 git init gitrepo &&
305 cd gitrepo &&
306 git remote add origin "hg::../hgrepo" &&
303 - echo one > content &&
307 + echo one >content &&
308 git add content &&
309 git commit -a -m one &&
310 git push origin master
311 ) &&
312
309 - hg -R hgrepo log > actual &&
313 + hg -R hgrepo log >actual &&
314 cat actual &&
315 test_cmp expected actual &&
316
@@ -322,7 +326,7 @@ test_expect_success 'remote cloning' '
326 (
327 hg init hgrepo &&
328 cd hgrepo &&
325 - echo zero > content &&
329 + echo zero >content &&
330 hg add content &&
331 hg commit -m zero
332 ) &&
@@ -343,7 +347,7 @@ test_expect_success 'remote update bookmark' '
347 git clone "hg::hgrepo" gitrepo &&
348 cd gitrepo &&
349 git checkout --quiet devel &&
346 - echo devel > content &&
350 + echo devel >content &&
351 git commit -a -m devel &&
352 git push --quiet
353 ) &&
@@ -358,7 +362,7 @@ test_expect_success 'remote new bookmark' '
362 git clone "hg::hgrepo" gitrepo &&
363 cd gitrepo &&
364 git checkout --quiet -b feature-b &&
361 - echo feature-b > content &&
365 + echo feature-b >content &&
366 git commit -a -m feature-b &&
367 git push --quiet origin feature-b
368 ) &&
@@ -374,15 +378,15 @@ test_expect_success 'remote push diverged' '
378 (
379 cd hgrepo &&
380 hg checkout default &&
377 - echo bump > content &&
381 + echo bump >content &&
382 hg commit -m bump
383 ) &&
384
385 (
386 cd gitrepo &&
383 - echo diverge > content &&
387 + echo diverge >content &&
388 git commit -a -m diverged &&
385 - check_push 1 <<-EOF
389 + check_push 1 <<-\EOF
390 master:non-fast-forward
391 EOF
392 ) &&
@@ -403,16 +407,16 @@ test_expect_success 'remote update bookmark diverge' '
407
408 (
409 cd hgrepo &&
406 - echo "bump bookmark" > content &&
410 + echo "bump bookmark" >content &&
411 hg commit -m "bump bookmark"
412 ) &&
413
414 (
415 cd gitrepo &&
416 git checkout --quiet diverge &&
413 - echo diverge > content &&
417 + echo diverge >content &&
418 git commit -a -m diverge &&
415 - check_push 1 <<-EOF
419 + check_push 1 <<-\EOF
420 diverge:fetch-first
421 EOF
422 ) &&
@@ -427,7 +431,7 @@ test_expect_success 'remote new bookmark multiple branch head' '
431 git clone "hg::hgrepo" gitrepo &&
432 cd gitrepo &&
433 git checkout --quiet -b feature-c HEAD^ &&
430 - echo feature-c > content &&
434 + echo feature-c >content &&
435 git commit -a -m feature-c &&
436 git push --quiet origin feature-c
437 ) &&
@@ -442,20 +446,20 @@ setup_big_push () {
446 (
447 hg init hgrepo &&
448 cd hgrepo &&
445 - echo zero > content &&
449 + echo zero >content &&
450 hg add content &&
451 hg commit -m zero &&
452 hg bookmark bad_bmark1 &&
449 - echo one > content &&
453 + echo one >content &&
454 hg commit -m one &&
455 hg bookmark bad_bmark2 &&
456 hg bookmark good_bmark &&
457 hg bookmark -i good_bmark &&
458 hg -q branch good_branch &&
455 - echo "good branch" > content &&
459 + echo "good branch" >content &&
460 hg commit -m "good branch" &&
461 hg -q branch bad_branch &&
458 - echo "bad branch" > content &&
462 + echo "bad branch" >content &&
463 hg commit -m "bad branch"
464 ) &&
465
@@ -463,40 +467,40 @@ setup_big_push () {
467
468 (
469 cd gitrepo &&
466 - echo two > content &&
470 + echo two >content &&
471 git commit -q -a -m two &&
472
473 git checkout -q good_bmark &&
470 - echo three > content &&
474 + echo three >content &&
475 git commit -q -a -m three &&
476
477 git checkout -q bad_bmark1 &&
478 git reset --hard HEAD^ &&
475 - echo four > content &&
479 + echo four >content &&
480 git commit -q -a -m four &&
481
482 git checkout -q bad_bmark2 &&
483 git reset --hard HEAD^ &&
480 - echo five > content &&
484 + echo five >content &&
485 git commit -q -a -m five &&
486
487 git checkout -q -b new_bmark master &&
484 - echo six > content &&
488 + echo six >content &&
489 git commit -q -a -m six &&
490
491 git checkout -q branches/good_branch &&
488 - echo seven > content &&
492 + echo seven >content &&
493 git commit -q -a -m seven &&
490 - echo eight > content &&
494 + echo eight >content &&
495 git commit -q -a -m eight &&
496
497 git checkout -q branches/bad_branch &&
498 git reset --hard HEAD^ &&
495 - echo nine > content &&
499 + echo nine >content &&
500 git commit -q -a -m nine &&
501
502 git checkout -q -b branches/new_branch master &&
499 - echo ten > content &&
503 + echo ten >content &&
504 git commit -q -a -m ten
505 )
506 }
@@ -509,7 +513,7 @@ test_expect_success 'remote big push' '
513 (
514 cd gitrepo &&
515
512 - check_push 1 --all <<-EOF
516 + check_push 1 --all <<-\EOF
517 master
518 good_bmark
519 branches/good_branch
@@ -537,17 +541,17 @@ test_expect_success 'remote big push fetch first' '
541 (
542 hg init hgrepo &&
543 cd hgrepo &&
540 - echo zero > content &&
544 + echo zero >content &&
545 hg add content &&
546 hg commit -m zero &&
547 hg bookmark bad_bmark &&
548 hg bookmark good_bmark &&
549 hg bookmark -i good_bmark &&
550 hg -q branch good_branch &&
547 - echo "good branch" > content &&
551 + echo "good branch" >content &&
552 hg commit -m "good branch" &&
553 hg -q branch bad_branch &&
550 - echo "bad branch" > content &&
554 + echo "bad branch" >content &&
555 hg commit -m "bad branch"
556 ) &&
557
@@ -556,28 +560,28 @@ test_expect_success 'remote big push fetch first' '
560 (
561 cd hgrepo &&
562 hg bookmark -f bad_bmark &&
559 - echo update_bmark > content &&
563 + echo update_bmark >content &&
564 hg commit -m "update bmark"
565 ) &&
566
567 (
568 cd gitrepo &&
565 - echo two > content &&
569 + echo two >content &&
570 git commit -q -a -m two &&
571
572 git checkout -q good_bmark &&
569 - echo three > content &&
573 + echo three >content &&
574 git commit -q -a -m three &&
575
576 git checkout -q bad_bmark &&
573 - echo four > content &&
577 + echo four >content &&
578 git commit -q -a -m four &&
579
580 git checkout -q branches/bad_branch &&
577 - echo five > content &&
581 + echo five >content &&
582 git commit -q -a -m five &&
583
580 - check_push 1 --all <<-EOF &&
584 + check_push 1 --all <<-\EOF &&
585 master
586 good_bmark
587 bad_bmark:fetch-first
@@ -586,7 +590,7 @@ test_expect_success 'remote big push fetch first' '
590
591 git fetch &&
592
589 - check_push 1 --all <<-EOF
593 + check_push 1 --all <<-\EOF
594 master
595 good_bmark
596 bad_bmark:non-fast-forward
@@ -603,7 +607,7 @@ test_expect_failure 'remote big push force' '
607 (
608 cd gitrepo &&
609
606 - check_push 0 --force --all <<-EOF
610 + check_push 0 --force --all <<-\EOF
611 master
612 good_bmark
613 branches/good_branch
@@ -633,7 +637,7 @@ test_expect_failure 'remote big push dry-run' '
637 (
638 cd gitrepo &&
639
636 - check_push 1 --dry-run --all <<-EOF &&
640 + check_push 1 --dry-run --all <<-\EOF &&
641 master
642 good_bmark
643 branches/good_branch
@@ -644,7 +648,7 @@ test_expect_failure 'remote big push dry-run' '
648 branches/bad_branch:non-fast-forward
649 EOF
650
647 - check_push 0 --dry-run master good_bmark new_bmark branches/good_branch branches/new_branch <<-EOF
651 + check_push 0 --dry-run master good_bmark new_bmark branches/good_branch branches/new_branch <<-\EOF
652 master
653 good_bmark
654 branches/good_branch
@@ -669,10 +673,10 @@ test_expect_success 'remote double failed push' '
673 (
674 hg init hgrepo &&
675 cd hgrepo &&
672 - echo zero > content &&
676 + echo zero >content &&
677 hg add content &&
678 hg commit -m zero &&
675 - echo one > content &&
679 + echo one >content &&
680 hg commit -m one
681 ) &&
682
@@ -680,7 +684,7 @@ test_expect_success 'remote double failed push' '
684 git clone "hg::hgrepo" gitrepo &&
685 cd gitrepo &&
686 git reset --hard HEAD^ &&
683 - echo two > content &&
687 + echo two >content &&
688 git commit -a -m two &&
689 test_expect_code 1 git push &&
690 test_expect_code 1 git push