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