@@ -7,19 +7,21 @@ test_description='Test remote-bzr'
7
7
8
8
. ./test-lib.sh
9
9
10
- if ! test_have_prereq PYTHON; then
10
+ if ! test_have_prereq PYTHON
11
+ then
11
12
skip_all=' skipping remote-bzr tests; python not available'
12
13
test_done
13
14
fi
14
15
15
- if ! python -c ' import bzrlib' ; then
16
+ if ! python -c ' import bzrlib'
17
+ then
16
18
skip_all=' skipping remote-bzr tests; bzr not available'
17
19
test_done
18
20
fi
19
21
20
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
23
25
test_cmp expected actual
24
26
}
25
27
@@ -29,7 +31,7 @@ test_expect_success 'cloning' '
29
31
(
30
32
bzr init bzrrepo &&
31
33
cd bzrrepo &&
32
- echo one > content &&
34
+ echo one >content &&
33
35
bzr add content &&
34
36
bzr commit -m one
35
37
) &&
@@ -41,7 +43,7 @@ test_expect_success 'cloning' '
41
43
test_expect_success ' pulling' '
42
44
(
43
45
cd bzrrepo &&
44
- echo two > content &&
46
+ echo two >content &&
45
47
bzr commit -m two
46
48
) &&
47
49
@@ -53,30 +55,30 @@ test_expect_success 'pulling' '
53
55
test_expect_success ' pushing' '
54
56
(
55
57
cd gitrepo &&
56
- echo three > content &&
58
+ echo three >content &&
57
59
git commit -a -m three &&
58
60
git push
59
61
) &&
60
62
61
- echo three > expected &&
62
- cat bzrrepo/content > actual &&
63
+ echo three >expected &&
64
+ cat bzrrepo/content >actual &&
63
65
test_cmp expected actual
64
66
'
65
67
66
68
test_expect_success ' roundtrip' '
67
69
(
68
70
cd gitrepo &&
69
71
git pull &&
70
- git log --format="%s" -1 origin/master > actual
72
+ git log --format="%s" -1 origin/master >actual
71
73
) &&
72
- echo three > expected &&
74
+ echo three >expected &&
73
75
test_cmp expected actual &&
74
76
75
77
(cd gitrepo && git push && git pull) &&
76
78
77
79
(
78
80
cd bzrrepo &&
79
- echo four > content &&
81
+ echo four >content &&
80
82
bzr commit -m four
81
83
) &&
82
84
@@ -86,19 +88,19 @@ test_expect_success 'roundtrip' '
86
88
87
89
(
88
90
cd gitrepo &&
89
- echo five > content &&
91
+ echo five >content &&
90
92
git commit -a -m five &&
91
93
git push && git pull
92
94
) &&
93
95
94
96
(cd bzrrepo && bzr revert) &&
95
97
96
- echo five > expected &&
97
- cat bzrrepo/content > actual &&
98
+ echo five >expected &&
99
+ cat bzrrepo/content >actual &&
98
100
test_cmp expected actual
99
101
'
100
102
101
- cat > expected << EOF
103
+ cat > expected << \ EOF
102
104
100644 blob 54f9d6da5c91d556e6b54340b1327573073030af content
103
105
100755 blob 68769579c3eaadbe555379b9c3538e6628bae1eb executable
104
106
120000 blob 6b584e8ece562ebffc15d38808cd6b98fc3d97ea link
107
109
test_expect_success ' special modes' '
108
110
(
109
111
cd bzrrepo &&
110
- echo exec > executable
112
+ echo exec >executable
111
113
chmod +x executable &&
112
114
bzr add executable
113
115
bzr commit -m exec &&
@@ -122,21 +124,21 @@ test_expect_success 'special modes' '
122
124
(
123
125
cd gitrepo &&
124
126
git pull
125
- git ls-tree HEAD > ../actual
127
+ git ls-tree HEAD >../actual
126
128
) &&
127
129
128
130
test_cmp expected actual &&
129
131
130
132
(
131
133
cd gitrepo &&
132
- git cat-file -p HEAD:link > ../actual
134
+ git cat-file -p HEAD:link >../actual
133
135
) &&
134
136
135
- printf content > expected &&
137
+ printf content >expected &&
136
138
test_cmp expected actual
137
139
'
138
140
139
- cat > expected << EOF
141
+ cat > expected << \ EOF
140
142
100644 blob 54f9d6da5c91d556e6b54340b1327573073030af content
141
143
100755 blob 68769579c3eaadbe555379b9c3538e6628bae1eb executable
142
144
120000 blob 6b584e8ece562ebffc15d38808cd6b98fc3d97ea link
@@ -147,8 +149,8 @@ test_expect_success 'moving directory' '
147
149
(
148
150
cd bzrrepo &&
149
151
mkdir movedir &&
150
- echo one > movedir/one &&
151
- echo two > movedir/two &&
152
+ echo one >movedir/one &&
153
+ echo two >movedir/two &&
152
154
bzr add movedir &&
153
155
bzr commit -m movedir &&
154
156
bzr mv movedir movedir-new &&
@@ -158,7 +160,7 @@ test_expect_success 'moving directory' '
158
160
(
159
161
cd gitrepo &&
160
162
git pull &&
161
- git ls-tree HEAD > ../actual
163
+ git ls-tree HEAD >../actual
162
164
) &&
163
165
164
166
test_cmp expected actual
@@ -167,7 +169,7 @@ test_expect_success 'moving directory' '
167
169
test_expect_success ' different authors' '
168
170
(
169
171
cd bzrrepo &&
170
- echo john >> content &&
172
+ echo john >>content &&
171
173
bzr commit -m john \
172
174
--author "Jane Rey <[email protected] >" \
173
175
--author "John Doe <[email protected] >"
@@ -176,10 +178,10 @@ test_expect_success 'different authors' '
176
178
(
177
179
cd gitrepo &&
178
180
git pull &&
179
- git show --format="%an <%ae>, %cn <%ce>" --quiet > ../actual
181
+ git show --format="%an <%ae>, %cn <%ce>" --quiet >../actual
180
182
) &&
181
183
182
- echo "Jane Rey <[email protected] >, A U Thor <[email protected] >" > expected &&
184
+ echo "Jane Rey <[email protected] >, A U Thor <[email protected] >" >expected &&
183
185
test_cmp expected actual
184
186
'
185
187
@@ -196,12 +198,12 @@ test_expect_success 'fetch utf-8 filenames' '
196
198
bzr init bzrrepo &&
197
199
cd bzrrepo &&
198
200
199
- echo test >> "ærø" &&
201
+ echo test >>"ærø" &&
200
202
bzr add "ærø" &&
201
- echo test >> "ø~?" &&
203
+ echo test >>"ø~?" &&
202
204
bzr add "ø~?" &&
203
205
bzr commit -m add-utf-8 &&
204
- echo test >> "ærø" &&
206
+ echo test >>"ærø" &&
205
207
bzr commit -m test-utf-8 &&
206
208
bzr rm "ø~?" &&
207
209
bzr mv "ærø" "ø~?" &&
@@ -211,9 +213,9 @@ test_expect_success 'fetch utf-8 filenames' '
211
213
(
212
214
git clone "bzr::bzrrepo" gitrepo &&
213
215
cd gitrepo &&
214
- git -c core.quotepath=false ls-files > ../actual
216
+ git -c core.quotepath=false ls-files >../actual
215
217
) &&
216
- echo "ø~?" > expected &&
218
+ echo "ø~?" >expected &&
217
219
test_cmp expected actual
218
220
'
219
221
@@ -229,7 +231,7 @@ test_expect_success 'push utf-8 filenames' '
229
231
bzr init bzrrepo &&
230
232
cd bzrrepo &&
231
233
232
- echo one >> content &&
234
+ echo one >>content &&
233
235
bzr add content &&
234
236
bzr commit -m one
235
237
) &&
@@ -238,15 +240,15 @@ test_expect_success 'push utf-8 filenames' '
238
240
git clone "bzr::bzrrepo" gitrepo &&
239
241
cd gitrepo &&
240
242
241
- echo test >> "ærø" &&
243
+ echo test >>"ærø" &&
242
244
git add "ærø" &&
243
245
git commit -m utf-8 &&
244
246
245
247
git push
246
248
) &&
247
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 &&
250
252
test_cmp expected actual
251
253
'
252
254
@@ -256,7 +258,7 @@ test_expect_success 'pushing a merge' '
256
258
(
257
259
bzr init bzrrepo &&
258
260
cd bzrrepo &&
259
- echo one > content &&
261
+ echo one >content &&
260
262
bzr add content &&
261
263
bzr commit -m one
262
264
) &&
@@ -265,27 +267,27 @@ test_expect_success 'pushing a merge' '
265
267
266
268
(
267
269
cd bzrrepo &&
268
- echo two > content &&
270
+ echo two >content &&
269
271
bzr commit -m two
270
272
) &&
271
273
272
274
(
273
275
cd gitrepo &&
274
- echo three > content &&
276
+ echo three >content &&
275
277
git commit -a -m three &&
276
278
git fetch &&
277
279
git merge origin/master || true &&
278
- echo three > content &&
280
+ echo three >content &&
279
281
git commit -a --no-edit &&
280
282
git push
281
283
) &&
282
284
283
- echo three > expected &&
284
- cat bzrrepo/content > actual &&
285
+ echo three >expected &&
286
+ cat bzrrepo/content >actual &&
285
287
test_cmp expected actual
286
288
'
287
289
288
- cat > expected << EOF
290
+ cat > expected << \ EOF
289
291
origin/HEAD
290
292
origin/branch
291
293
origin/trunk
@@ -299,22 +301,22 @@ test_expect_success 'proper bzr repo' '
299
301
(
300
302
bzr init bzrrepo/trunk &&
301
303
cd bzrrepo/trunk &&
302
- echo one >> content &&
304
+ echo one >>content &&
303
305
bzr add content &&
304
306
bzr commit -m one
305
307
) &&
306
308
307
309
(
308
310
bzr branch bzrrepo/trunk bzrrepo/branch &&
309
311
cd bzrrepo/branch &&
310
- echo two >> content &&
312
+ echo two >>content &&
311
313
bzr commit -m one
312
314
) &&
313
315
314
316
(
315
317
git clone "bzr::bzrrepo" gitrepo &&
316
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
318
320
) &&
319
321
320
322
test_cmp expected actual
@@ -327,11 +329,11 @@ test_expect_success 'strip' '
327
329
bzr init bzrrepo &&
328
330
cd bzrrepo &&
329
331
330
- echo one >> content &&
332
+ echo one >>content &&
331
333
bzr add content &&
332
334
bzr commit -m one &&
333
335
334
- echo two >> content &&
336
+ echo two >>content &&
335
337
bzr commit -m two
336
338
) &&
337
339
@@ -341,18 +343,18 @@ test_expect_success 'strip' '
341
343
cd bzrrepo &&
342
344
bzr uncommit --force &&
343
345
344
- echo three >> content &&
346
+ echo three >>content &&
345
347
bzr commit -m three &&
346
348
347
- echo four >> content &&
349
+ echo four >>content &&
348
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
350
352
) &&
351
353
352
354
(
353
355
cd gitrepo &&
354
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
356
358
) &&
357
359
358
360
test_cmp expected actual
@@ -372,7 +374,7 @@ test_expect_success 'export utf-8 authors' '
372
374
(
373
375
git init gitrepo &&
374
376
cd gitrepo &&
375
- echo greg >> content &&
377
+ echo greg >>content &&
376
378
git add content &&
377
379
git commit -m one &&
378
380
git remote add bzr "bzr::../bzrrepo" &&
@@ -381,10 +383,10 @@ test_expect_success 'export utf-8 authors' '
381
383
382
384
(
383
385
cd bzrrepo &&
384
- bzr log | grep "^committer: " > ../actual
386
+ bzr log | grep "^committer: " >../actual
385
387
) &&
386
388
387
- echo "committer: Grégoire <[email protected] >" > expected &&
389
+ echo "committer: Grégoire <[email protected] >" >expected &&
388
390
test_cmp expected actual
389
391
'
390
392
0 commit comments