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