##// END OF EJS Templates
test-clone: fix for vfat...
Adrian Buehlmann -
r17307:a028ce66 stable
parent child Browse files
Show More
@@ -1,566 +1,567 b''
1 Prepare repo a:
1 Prepare repo a:
2
2
3 $ hg init a
3 $ hg init a
4 $ cd a
4 $ cd a
5 $ echo a > a
5 $ echo a > a
6 $ hg add a
6 $ hg add a
7 $ hg commit -m test
7 $ hg commit -m test
8 $ echo first line > b
8 $ echo first line > b
9 $ hg add b
9 $ hg add b
10
10
11 Create a non-inlined filelog:
11 Create a non-inlined filelog:
12
12
13 $ python -c 'file("data1", "wb").write("".join("%s\n" % x for x in range(10000)))'
13 $ python -c 'file("data1", "wb").write("".join("%s\n" % x for x in range(10000)))'
14 $ for j in 0 1 2 3 4 5 6 7 8 9; do
14 $ for j in 0 1 2 3 4 5 6 7 8 9; do
15 > cat data1 >> b
15 > cat data1 >> b
16 > hg commit -m test
16 > hg commit -m test
17 > done
17 > done
18
18
19 List files in store/data (should show a 'b.d'):
19 List files in store/data (should show a 'b.d'):
20
20
21 $ for i in .hg/store/data/*; do
21 $ for i in .hg/store/data/*; do
22 > echo $i
22 > echo $i
23 > done
23 > done
24 .hg/store/data/a.i
24 .hg/store/data/a.i
25 .hg/store/data/b.d
25 .hg/store/data/b.d
26 .hg/store/data/b.i
26 .hg/store/data/b.i
27
27
28 Default operation:
28 Default operation:
29
29
30 $ hg clone . ../b
30 $ hg clone . ../b
31 updating to branch default
31 updating to branch default
32 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
32 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
33 $ cd ../b
33 $ cd ../b
34 $ cat a
34 $ cat a
35 a
35 a
36 $ hg verify
36 $ hg verify
37 checking changesets
37 checking changesets
38 checking manifests
38 checking manifests
39 crosschecking files in changesets and manifests
39 crosschecking files in changesets and manifests
40 checking files
40 checking files
41 2 files, 11 changesets, 11 total revisions
41 2 files, 11 changesets, 11 total revisions
42
42
43 Invalid dest '' must abort:
43 Invalid dest '' must abort:
44
44
45 $ hg clone . ''
45 $ hg clone . ''
46 abort: empty destination path is not valid
46 abort: empty destination path is not valid
47 [255]
47 [255]
48
48
49 No update, with debug option:
49 No update, with debug option:
50
50
51 #if hardlink
51 #if hardlink
52 $ hg --debug clone -U . ../c
52 $ hg --debug clone -U . ../c
53 linked 8 files
53 linked 8 files
54 listing keys for "bookmarks"
54 listing keys for "bookmarks"
55 #else
55 #else
56 $ hg --debug clone -U . ../c
56 $ hg --debug clone -U . ../c
57 copied 8 files
57 copied 8 files
58 listing keys for "bookmarks"
58 #endif
59 #endif
59 $ cd ../c
60 $ cd ../c
60 $ cat a 2>/dev/null || echo "a not present"
61 $ cat a 2>/dev/null || echo "a not present"
61 a not present
62 a not present
62 $ hg verify
63 $ hg verify
63 checking changesets
64 checking changesets
64 checking manifests
65 checking manifests
65 crosschecking files in changesets and manifests
66 crosschecking files in changesets and manifests
66 checking files
67 checking files
67 2 files, 11 changesets, 11 total revisions
68 2 files, 11 changesets, 11 total revisions
68
69
69 Default destination:
70 Default destination:
70
71
71 $ mkdir ../d
72 $ mkdir ../d
72 $ cd ../d
73 $ cd ../d
73 $ hg clone ../a
74 $ hg clone ../a
74 destination directory: a
75 destination directory: a
75 updating to branch default
76 updating to branch default
76 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
77 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
77 $ cd a
78 $ cd a
78 $ hg cat a
79 $ hg cat a
79 a
80 a
80 $ cd ../..
81 $ cd ../..
81
82
82 Check that we drop the 'file:' from the path before writing the .hgrc:
83 Check that we drop the 'file:' from the path before writing the .hgrc:
83
84
84 $ hg clone file:a e
85 $ hg clone file:a e
85 updating to branch default
86 updating to branch default
86 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
87 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
87 $ grep 'file:' e/.hg/hgrc
88 $ grep 'file:' e/.hg/hgrc
88 [1]
89 [1]
89
90
90 Check that path aliases are expanded:
91 Check that path aliases are expanded:
91
92
92 $ hg clone -q -U --config 'paths.foobar=a#0' foobar f
93 $ hg clone -q -U --config 'paths.foobar=a#0' foobar f
93 $ hg -R f showconfig paths.default
94 $ hg -R f showconfig paths.default
94 $TESTTMP/a#0 (glob)
95 $TESTTMP/a#0 (glob)
95
96
96 Use --pull:
97 Use --pull:
97
98
98 $ hg clone --pull a g
99 $ hg clone --pull a g
99 requesting all changes
100 requesting all changes
100 adding changesets
101 adding changesets
101 adding manifests
102 adding manifests
102 adding file changes
103 adding file changes
103 added 11 changesets with 11 changes to 2 files
104 added 11 changesets with 11 changes to 2 files
104 updating to branch default
105 updating to branch default
105 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
106 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
106 $ hg -R g verify
107 $ hg -R g verify
107 checking changesets
108 checking changesets
108 checking manifests
109 checking manifests
109 crosschecking files in changesets and manifests
110 crosschecking files in changesets and manifests
110 checking files
111 checking files
111 2 files, 11 changesets, 11 total revisions
112 2 files, 11 changesets, 11 total revisions
112
113
113 Invalid dest '' with --pull must abort (issue2528):
114 Invalid dest '' with --pull must abort (issue2528):
114
115
115 $ hg clone --pull a ''
116 $ hg clone --pull a ''
116 abort: empty destination path is not valid
117 abort: empty destination path is not valid
117 [255]
118 [255]
118
119
119 Clone to '.':
120 Clone to '.':
120
121
121 $ mkdir h
122 $ mkdir h
122 $ cd h
123 $ cd h
123 $ hg clone ../a .
124 $ hg clone ../a .
124 updating to branch default
125 updating to branch default
125 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
126 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
126 $ cd ..
127 $ cd ..
127
128
128
129
129 *** Tests for option -u ***
130 *** Tests for option -u ***
130
131
131 Adding some more history to repo a:
132 Adding some more history to repo a:
132
133
133 $ cd a
134 $ cd a
134 $ hg tag ref1
135 $ hg tag ref1
135 $ echo the quick brown fox >a
136 $ echo the quick brown fox >a
136 $ hg ci -m "hacked default"
137 $ hg ci -m "hacked default"
137 $ hg up ref1
138 $ hg up ref1
138 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
139 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
139 $ hg branch stable
140 $ hg branch stable
140 marked working directory as branch stable
141 marked working directory as branch stable
141 (branches are permanent and global, did you want a bookmark?)
142 (branches are permanent and global, did you want a bookmark?)
142 $ echo some text >a
143 $ echo some text >a
143 $ hg ci -m "starting branch stable"
144 $ hg ci -m "starting branch stable"
144 $ hg tag ref2
145 $ hg tag ref2
145 $ echo some more text >a
146 $ echo some more text >a
146 $ hg ci -m "another change for branch stable"
147 $ hg ci -m "another change for branch stable"
147 $ hg up ref2
148 $ hg up ref2
148 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
149 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
149 $ hg parents
150 $ hg parents
150 changeset: 13:e8ece76546a6
151 changeset: 13:e8ece76546a6
151 branch: stable
152 branch: stable
152 tag: ref2
153 tag: ref2
153 parent: 10:a7949464abda
154 parent: 10:a7949464abda
154 user: test
155 user: test
155 date: Thu Jan 01 00:00:00 1970 +0000
156 date: Thu Jan 01 00:00:00 1970 +0000
156 summary: starting branch stable
157 summary: starting branch stable
157
158
158
159
159 Repo a has two heads:
160 Repo a has two heads:
160
161
161 $ hg heads
162 $ hg heads
162 changeset: 15:0aae7cf88f0d
163 changeset: 15:0aae7cf88f0d
163 branch: stable
164 branch: stable
164 tag: tip
165 tag: tip
165 user: test
166 user: test
166 date: Thu Jan 01 00:00:00 1970 +0000
167 date: Thu Jan 01 00:00:00 1970 +0000
167 summary: another change for branch stable
168 summary: another change for branch stable
168
169
169 changeset: 12:f21241060d6a
170 changeset: 12:f21241060d6a
170 user: test
171 user: test
171 date: Thu Jan 01 00:00:00 1970 +0000
172 date: Thu Jan 01 00:00:00 1970 +0000
172 summary: hacked default
173 summary: hacked default
173
174
174
175
175 $ cd ..
176 $ cd ..
176
177
177
178
178 Testing --noupdate with --updaterev (must abort):
179 Testing --noupdate with --updaterev (must abort):
179
180
180 $ hg clone --noupdate --updaterev 1 a ua
181 $ hg clone --noupdate --updaterev 1 a ua
181 abort: cannot specify both --noupdate and --updaterev
182 abort: cannot specify both --noupdate and --updaterev
182 [255]
183 [255]
183
184
184
185
185 Testing clone -u:
186 Testing clone -u:
186
187
187 $ hg clone -u . a ua
188 $ hg clone -u . a ua
188 updating to branch stable
189 updating to branch stable
189 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
190 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
190
191
191 Repo ua has both heads:
192 Repo ua has both heads:
192
193
193 $ hg -R ua heads
194 $ hg -R ua heads
194 changeset: 15:0aae7cf88f0d
195 changeset: 15:0aae7cf88f0d
195 branch: stable
196 branch: stable
196 tag: tip
197 tag: tip
197 user: test
198 user: test
198 date: Thu Jan 01 00:00:00 1970 +0000
199 date: Thu Jan 01 00:00:00 1970 +0000
199 summary: another change for branch stable
200 summary: another change for branch stable
200
201
201 changeset: 12:f21241060d6a
202 changeset: 12:f21241060d6a
202 user: test
203 user: test
203 date: Thu Jan 01 00:00:00 1970 +0000
204 date: Thu Jan 01 00:00:00 1970 +0000
204 summary: hacked default
205 summary: hacked default
205
206
206
207
207 Same revision checked out in repo a and ua:
208 Same revision checked out in repo a and ua:
208
209
209 $ hg -R a parents --template "{node|short}\n"
210 $ hg -R a parents --template "{node|short}\n"
210 e8ece76546a6
211 e8ece76546a6
211 $ hg -R ua parents --template "{node|short}\n"
212 $ hg -R ua parents --template "{node|short}\n"
212 e8ece76546a6
213 e8ece76546a6
213
214
214 $ rm -r ua
215 $ rm -r ua
215
216
216
217
217 Testing clone --pull -u:
218 Testing clone --pull -u:
218
219
219 $ hg clone --pull -u . a ua
220 $ hg clone --pull -u . a ua
220 requesting all changes
221 requesting all changes
221 adding changesets
222 adding changesets
222 adding manifests
223 adding manifests
223 adding file changes
224 adding file changes
224 added 16 changesets with 16 changes to 3 files (+1 heads)
225 added 16 changesets with 16 changes to 3 files (+1 heads)
225 updating to branch stable
226 updating to branch stable
226 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
227 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
227
228
228 Repo ua has both heads:
229 Repo ua has both heads:
229
230
230 $ hg -R ua heads
231 $ hg -R ua heads
231 changeset: 15:0aae7cf88f0d
232 changeset: 15:0aae7cf88f0d
232 branch: stable
233 branch: stable
233 tag: tip
234 tag: tip
234 user: test
235 user: test
235 date: Thu Jan 01 00:00:00 1970 +0000
236 date: Thu Jan 01 00:00:00 1970 +0000
236 summary: another change for branch stable
237 summary: another change for branch stable
237
238
238 changeset: 12:f21241060d6a
239 changeset: 12:f21241060d6a
239 user: test
240 user: test
240 date: Thu Jan 01 00:00:00 1970 +0000
241 date: Thu Jan 01 00:00:00 1970 +0000
241 summary: hacked default
242 summary: hacked default
242
243
243
244
244 Same revision checked out in repo a and ua:
245 Same revision checked out in repo a and ua:
245
246
246 $ hg -R a parents --template "{node|short}\n"
247 $ hg -R a parents --template "{node|short}\n"
247 e8ece76546a6
248 e8ece76546a6
248 $ hg -R ua parents --template "{node|short}\n"
249 $ hg -R ua parents --template "{node|short}\n"
249 e8ece76546a6
250 e8ece76546a6
250
251
251 $ rm -r ua
252 $ rm -r ua
252
253
253
254
254 Testing clone -u <branch>:
255 Testing clone -u <branch>:
255
256
256 $ hg clone -u stable a ua
257 $ hg clone -u stable a ua
257 updating to branch stable
258 updating to branch stable
258 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
259 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
259
260
260 Repo ua has both heads:
261 Repo ua has both heads:
261
262
262 $ hg -R ua heads
263 $ hg -R ua heads
263 changeset: 15:0aae7cf88f0d
264 changeset: 15:0aae7cf88f0d
264 branch: stable
265 branch: stable
265 tag: tip
266 tag: tip
266 user: test
267 user: test
267 date: Thu Jan 01 00:00:00 1970 +0000
268 date: Thu Jan 01 00:00:00 1970 +0000
268 summary: another change for branch stable
269 summary: another change for branch stable
269
270
270 changeset: 12:f21241060d6a
271 changeset: 12:f21241060d6a
271 user: test
272 user: test
272 date: Thu Jan 01 00:00:00 1970 +0000
273 date: Thu Jan 01 00:00:00 1970 +0000
273 summary: hacked default
274 summary: hacked default
274
275
275
276
276 Branch 'stable' is checked out:
277 Branch 'stable' is checked out:
277
278
278 $ hg -R ua parents
279 $ hg -R ua parents
279 changeset: 15:0aae7cf88f0d
280 changeset: 15:0aae7cf88f0d
280 branch: stable
281 branch: stable
281 tag: tip
282 tag: tip
282 user: test
283 user: test
283 date: Thu Jan 01 00:00:00 1970 +0000
284 date: Thu Jan 01 00:00:00 1970 +0000
284 summary: another change for branch stable
285 summary: another change for branch stable
285
286
286
287
287 $ rm -r ua
288 $ rm -r ua
288
289
289
290
290 Testing default checkout:
291 Testing default checkout:
291
292
292 $ hg clone a ua
293 $ hg clone a ua
293 updating to branch default
294 updating to branch default
294 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
295 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
295
296
296 Repo ua has both heads:
297 Repo ua has both heads:
297
298
298 $ hg -R ua heads
299 $ hg -R ua heads
299 changeset: 15:0aae7cf88f0d
300 changeset: 15:0aae7cf88f0d
300 branch: stable
301 branch: stable
301 tag: tip
302 tag: tip
302 user: test
303 user: test
303 date: Thu Jan 01 00:00:00 1970 +0000
304 date: Thu Jan 01 00:00:00 1970 +0000
304 summary: another change for branch stable
305 summary: another change for branch stable
305
306
306 changeset: 12:f21241060d6a
307 changeset: 12:f21241060d6a
307 user: test
308 user: test
308 date: Thu Jan 01 00:00:00 1970 +0000
309 date: Thu Jan 01 00:00:00 1970 +0000
309 summary: hacked default
310 summary: hacked default
310
311
311
312
312 Branch 'default' is checked out:
313 Branch 'default' is checked out:
313
314
314 $ hg -R ua parents
315 $ hg -R ua parents
315 changeset: 12:f21241060d6a
316 changeset: 12:f21241060d6a
316 user: test
317 user: test
317 date: Thu Jan 01 00:00:00 1970 +0000
318 date: Thu Jan 01 00:00:00 1970 +0000
318 summary: hacked default
319 summary: hacked default
319
320
320
321
321 $ rm -r ua
322 $ rm -r ua
322
323
323
324
324 Testing #<branch>:
325 Testing #<branch>:
325
326
326 $ hg clone -u . a#stable ua
327 $ hg clone -u . a#stable ua
327 adding changesets
328 adding changesets
328 adding manifests
329 adding manifests
329 adding file changes
330 adding file changes
330 added 14 changesets with 14 changes to 3 files
331 added 14 changesets with 14 changes to 3 files
331 updating to branch stable
332 updating to branch stable
332 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
333 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
333
334
334 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
335 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
335
336
336 $ hg -R ua heads
337 $ hg -R ua heads
337 changeset: 13:0aae7cf88f0d
338 changeset: 13:0aae7cf88f0d
338 branch: stable
339 branch: stable
339 tag: tip
340 tag: tip
340 user: test
341 user: test
341 date: Thu Jan 01 00:00:00 1970 +0000
342 date: Thu Jan 01 00:00:00 1970 +0000
342 summary: another change for branch stable
343 summary: another change for branch stable
343
344
344 changeset: 10:a7949464abda
345 changeset: 10:a7949464abda
345 user: test
346 user: test
346 date: Thu Jan 01 00:00:00 1970 +0000
347 date: Thu Jan 01 00:00:00 1970 +0000
347 summary: test
348 summary: test
348
349
349
350
350 Same revision checked out in repo a and ua:
351 Same revision checked out in repo a and ua:
351
352
352 $ hg -R a parents --template "{node|short}\n"
353 $ hg -R a parents --template "{node|short}\n"
353 e8ece76546a6
354 e8ece76546a6
354 $ hg -R ua parents --template "{node|short}\n"
355 $ hg -R ua parents --template "{node|short}\n"
355 e8ece76546a6
356 e8ece76546a6
356
357
357 $ rm -r ua
358 $ rm -r ua
358
359
359
360
360 Testing -u -r <branch>:
361 Testing -u -r <branch>:
361
362
362 $ hg clone -u . -r stable a ua
363 $ hg clone -u . -r stable a ua
363 adding changesets
364 adding changesets
364 adding manifests
365 adding manifests
365 adding file changes
366 adding file changes
366 added 14 changesets with 14 changes to 3 files
367 added 14 changesets with 14 changes to 3 files
367 updating to branch stable
368 updating to branch stable
368 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
369 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
369
370
370 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
371 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
371
372
372 $ hg -R ua heads
373 $ hg -R ua heads
373 changeset: 13:0aae7cf88f0d
374 changeset: 13:0aae7cf88f0d
374 branch: stable
375 branch: stable
375 tag: tip
376 tag: tip
376 user: test
377 user: test
377 date: Thu Jan 01 00:00:00 1970 +0000
378 date: Thu Jan 01 00:00:00 1970 +0000
378 summary: another change for branch stable
379 summary: another change for branch stable
379
380
380 changeset: 10:a7949464abda
381 changeset: 10:a7949464abda
381 user: test
382 user: test
382 date: Thu Jan 01 00:00:00 1970 +0000
383 date: Thu Jan 01 00:00:00 1970 +0000
383 summary: test
384 summary: test
384
385
385
386
386 Same revision checked out in repo a and ua:
387 Same revision checked out in repo a and ua:
387
388
388 $ hg -R a parents --template "{node|short}\n"
389 $ hg -R a parents --template "{node|short}\n"
389 e8ece76546a6
390 e8ece76546a6
390 $ hg -R ua parents --template "{node|short}\n"
391 $ hg -R ua parents --template "{node|short}\n"
391 e8ece76546a6
392 e8ece76546a6
392
393
393 $ rm -r ua
394 $ rm -r ua
394
395
395
396
396 Testing -r <branch>:
397 Testing -r <branch>:
397
398
398 $ hg clone -r stable a ua
399 $ hg clone -r stable a ua
399 adding changesets
400 adding changesets
400 adding manifests
401 adding manifests
401 adding file changes
402 adding file changes
402 added 14 changesets with 14 changes to 3 files
403 added 14 changesets with 14 changes to 3 files
403 updating to branch stable
404 updating to branch stable
404 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
405 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
405
406
406 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
407 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
407
408
408 $ hg -R ua heads
409 $ hg -R ua heads
409 changeset: 13:0aae7cf88f0d
410 changeset: 13:0aae7cf88f0d
410 branch: stable
411 branch: stable
411 tag: tip
412 tag: tip
412 user: test
413 user: test
413 date: Thu Jan 01 00:00:00 1970 +0000
414 date: Thu Jan 01 00:00:00 1970 +0000
414 summary: another change for branch stable
415 summary: another change for branch stable
415
416
416 changeset: 10:a7949464abda
417 changeset: 10:a7949464abda
417 user: test
418 user: test
418 date: Thu Jan 01 00:00:00 1970 +0000
419 date: Thu Jan 01 00:00:00 1970 +0000
419 summary: test
420 summary: test
420
421
421
422
422 Branch 'stable' is checked out:
423 Branch 'stable' is checked out:
423
424
424 $ hg -R ua parents
425 $ hg -R ua parents
425 changeset: 13:0aae7cf88f0d
426 changeset: 13:0aae7cf88f0d
426 branch: stable
427 branch: stable
427 tag: tip
428 tag: tip
428 user: test
429 user: test
429 date: Thu Jan 01 00:00:00 1970 +0000
430 date: Thu Jan 01 00:00:00 1970 +0000
430 summary: another change for branch stable
431 summary: another change for branch stable
431
432
432
433
433 $ rm -r ua
434 $ rm -r ua
434
435
435
436
436 Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not
437 Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not
437 iterable in addbranchrevs()
438 iterable in addbranchrevs()
438
439
439 $ cat <<EOF > simpleclone.py
440 $ cat <<EOF > simpleclone.py
440 > from mercurial import ui, hg
441 > from mercurial import ui, hg
441 > myui = ui.ui()
442 > myui = ui.ui()
442 > repo = hg.repository(myui, 'a')
443 > repo = hg.repository(myui, 'a')
443 > hg.clone(myui, {}, repo, dest="ua")
444 > hg.clone(myui, {}, repo, dest="ua")
444 > EOF
445 > EOF
445
446
446 $ python simpleclone.py
447 $ python simpleclone.py
447 updating to branch default
448 updating to branch default
448 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
449 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
449
450
450 $ rm -r ua
451 $ rm -r ua
451
452
452 $ cat <<EOF > branchclone.py
453 $ cat <<EOF > branchclone.py
453 > from mercurial import ui, hg, extensions
454 > from mercurial import ui, hg, extensions
454 > myui = ui.ui()
455 > myui = ui.ui()
455 > extensions.loadall(myui)
456 > extensions.loadall(myui)
456 > repo = hg.repository(myui, 'a')
457 > repo = hg.repository(myui, 'a')
457 > hg.clone(myui, {}, repo, dest="ua", branch=["stable",])
458 > hg.clone(myui, {}, repo, dest="ua", branch=["stable",])
458 > EOF
459 > EOF
459
460
460 $ python branchclone.py
461 $ python branchclone.py
461 adding changesets
462 adding changesets
462 adding manifests
463 adding manifests
463 adding file changes
464 adding file changes
464 added 14 changesets with 14 changes to 3 files
465 added 14 changesets with 14 changes to 3 files
465 updating to branch stable
466 updating to branch stable
466 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
467 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
467 $ rm -r ua
468 $ rm -r ua
468
469
469
470
470 Testing failures:
471 Testing failures:
471
472
472 $ mkdir fail
473 $ mkdir fail
473 $ cd fail
474 $ cd fail
474
475
475 No local source
476 No local source
476
477
477 $ hg clone a b
478 $ hg clone a b
478 abort: repository a not found!
479 abort: repository a not found!
479 [255]
480 [255]
480
481
481 No remote source
482 No remote source
482
483
483 $ hg clone http://127.0.0.1:3121/a b
484 $ hg clone http://127.0.0.1:3121/a b
484 abort: error: *refused* (glob)
485 abort: error: *refused* (glob)
485 [255]
486 [255]
486 $ rm -rf b # work around bug with http clone
487 $ rm -rf b # work around bug with http clone
487
488
488
489
489 #if unix-permissions
490 #if unix-permissions
490
491
491 Inaccessible source
492 Inaccessible source
492
493
493 $ mkdir a
494 $ mkdir a
494 $ chmod 000 a
495 $ chmod 000 a
495 $ hg clone a b
496 $ hg clone a b
496 abort: repository a not found!
497 abort: repository a not found!
497 [255]
498 [255]
498
499
499 Inaccessible destination
500 Inaccessible destination
500
501
501 $ hg init b
502 $ hg init b
502 $ cd b
503 $ cd b
503 $ hg clone . ../a
504 $ hg clone . ../a
504 abort: Permission denied: ../a
505 abort: Permission denied: ../a
505 [255]
506 [255]
506 $ cd ..
507 $ cd ..
507 $ chmod 700 a
508 $ chmod 700 a
508 $ rm -r a b
509 $ rm -r a b
509
510
510 #endif
511 #endif
511
512
512
513
513 #if fifo
514 #if fifo
514
515
515 Source of wrong type
516 Source of wrong type
516
517
517 $ mkfifo a
518 $ mkfifo a
518 $ hg clone a b
519 $ hg clone a b
519 abort: repository a not found!
520 abort: repository a not found!
520 [255]
521 [255]
521 $ rm a
522 $ rm a
522
523
523 #endif
524 #endif
524
525
525 Default destination, same directory
526 Default destination, same directory
526
527
527 $ hg init q
528 $ hg init q
528 $ hg clone q
529 $ hg clone q
529 destination directory: q
530 destination directory: q
530 abort: destination 'q' is not empty
531 abort: destination 'q' is not empty
531 [255]
532 [255]
532
533
533 destination directory not empty
534 destination directory not empty
534
535
535 $ mkdir a
536 $ mkdir a
536 $ echo stuff > a/a
537 $ echo stuff > a/a
537 $ hg clone q a
538 $ hg clone q a
538 abort: destination 'a' is not empty
539 abort: destination 'a' is not empty
539 [255]
540 [255]
540
541
541
542
542 #if unix-permissions
543 #if unix-permissions
543
544
544 leave existing directory in place after clone failure
545 leave existing directory in place after clone failure
545
546
546 $ hg init c
547 $ hg init c
547 $ cd c
548 $ cd c
548 $ echo c > c
549 $ echo c > c
549 $ hg commit -A -m test
550 $ hg commit -A -m test
550 adding c
551 adding c
551 $ chmod -rx .hg/store/data
552 $ chmod -rx .hg/store/data
552 $ cd ..
553 $ cd ..
553 $ mkdir d
554 $ mkdir d
554 $ hg clone c d 2> err
555 $ hg clone c d 2> err
555 [255]
556 [255]
556 $ test -d d
557 $ test -d d
557 $ test -d d/.hg
558 $ test -d d/.hg
558 [1]
559 [1]
559
560
560 reenable perm to allow deletion
561 reenable perm to allow deletion
561
562
562 $ chmod +rx c/.hg/store/data
563 $ chmod +rx c/.hg/store/data
563
564
564 #endif
565 #endif
565
566
566 $ cd ..
567 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now