##// END OF EJS Templates
largefiles: fix trailing spaces in test-largefiles.t...
Thomas Arendsen Hein -
r17594:536fee6a stable
parent child Browse files
Show More
@@ -1,1494 +1,1494 b''
1 1 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
2 2 $ mkdir "${USERCACHE}"
3 3 $ cat >> $HGRCPATH <<EOF
4 4 > [extensions]
5 5 > largefiles=
6 6 > purge=
7 7 > rebase=
8 8 > transplant=
9 9 > [phases]
10 10 > publish=False
11 11 > [largefiles]
12 12 > minsize=2
13 13 > patterns=glob:**.dat
14 14 > usercache=${USERCACHE}
15 15 > [hooks]
16 16 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
17 17 > EOF
18 18
19 19 Create the repo with a couple of revisions of both large and normal
20 20 files, testing that status correctly shows largefiles and that summary output
21 21 is correct.
22 22
23 23 $ hg init a
24 24 $ cd a
25 25 $ mkdir sub
26 26 $ echo normal1 > normal1
27 27 $ echo normal2 > sub/normal2
28 28 $ echo large1 > large1
29 29 $ echo large2 > sub/large2
30 30 $ hg add normal1 sub/normal2
31 31 $ hg add --large large1 sub/large2
32 32 $ hg commit -m "add files"
33 33 Invoking status precommit hook
34 34 A large1
35 35 A normal1
36 36 A sub/large2
37 37 A sub/normal2
38 38 $ echo normal11 > normal1
39 39 $ echo normal22 > sub/normal2
40 40 $ echo large11 > large1
41 41 $ echo large22 > sub/large2
42 42 $ hg commit -m "edit files"
43 43 Invoking status precommit hook
44 44 M large1
45 45 M normal1
46 46 M sub/large2
47 47 M sub/normal2
48 48 $ hg sum --large
49 49 parent: 1:ce8896473775 tip
50 50 edit files
51 51 branch: default
52 52 commit: (clean)
53 53 update: (current)
54 54 largefiles: No remote repo
55 55
56 56 Commit preserved largefile contents.
57 57
58 58 $ cat normal1
59 59 normal11
60 60 $ cat large1
61 61 large11
62 62 $ cat sub/normal2
63 63 normal22
64 64 $ cat sub/large2
65 65 large22
66 66
67 67 Test status, subdir and unknown files
68 68
69 69 $ echo unknown > sub/unknown
70 70 $ hg st --all
71 71 ? sub/unknown
72 72 C large1
73 73 C normal1
74 74 C sub/large2
75 75 C sub/normal2
76 76 $ hg st --all sub
77 77 ? sub/unknown
78 78 C sub/large2
79 79 C sub/normal2
80 80 $ rm sub/unknown
81 81
82 82 Test exit codes for remove warning cases (modified and still exiting)
83 83
84 84 $ hg remove -A large1
85 85 not removing large1: file still exists (use forget to undo)
86 86 [1]
87 87 $ echo 'modified' > large1
88 88 $ hg remove large1
89 89 not removing large1: file is modified (use forget to undo)
90 90 [1]
91 91 $ hg up -Cq
92 92
93 93 Remove both largefiles and normal files.
94
94
95 95 $ hg remove normal1 large1
96 96 $ hg status large1
97 97 R large1
98 98 $ hg commit -m "remove files"
99 99 Invoking status precommit hook
100 100 R large1
101 101 R normal1
102 102 $ ls
103 103 sub
104 104 $ echo "testlargefile" > large1-test
105 105 $ hg add --large large1-test
106 106 $ hg st
107 107 A large1-test
108 108 $ hg rm large1-test
109 109 not removing large1-test: file has been marked for add (use forget to undo)
110 110 [1]
111 111 $ hg st
112 112 A large1-test
113 113 $ hg forget large1-test
114 114 $ hg st
115 115 ? large1-test
116 116 $ hg remove large1-test
117 117 not removing large1-test: file is untracked
118 118 [1]
119 119 $ hg forget large1-test
120 120 not removing large1-test: file is already untracked
121 121 [1]
122 122 $ rm large1-test
123 123
124 124 Copy both largefiles and normal files (testing that status output is correct).
125 125
126 126 $ hg cp sub/normal2 normal1
127 127 $ hg cp sub/large2 large1
128 128 $ hg commit -m "copy files"
129 129 Invoking status precommit hook
130 130 A large1
131 131 A normal1
132 132 $ cat normal1
133 133 normal22
134 134 $ cat large1
135 135 large22
136 136
137 137 Test moving largefiles and verify that normal files are also unaffected.
138 138
139 139 $ hg mv normal1 normal3
140 140 $ hg mv large1 large3
141 141 $ hg mv sub/normal2 sub/normal4
142 142 $ hg mv sub/large2 sub/large4
143 143 $ hg commit -m "move files"
144 144 Invoking status precommit hook
145 145 A large3
146 146 A normal3
147 147 A sub/large4
148 148 A sub/normal4
149 149 R large1
150 150 R normal1
151 151 R sub/large2
152 152 R sub/normal2
153 153 $ cat normal3
154 154 normal22
155 155 $ cat large3
156 156 large22
157 157 $ cat sub/normal4
158 158 normal22
159 159 $ cat sub/large4
160 160 large22
161 161
162 162 Test copies and moves from a directory other than root (issue3516)
163 163
164 164 $ cd ..
165 165 $ hg init lf_cpmv
166 166 $ cd lf_cpmv
167 167 $ mkdir dira
168 168 $ mkdir dira/dirb
169 169 $ touch dira/dirb/largefile
170 170 $ hg add --large dira/dirb/largefile
171 171 $ hg commit -m "added"
172 172 Invoking status precommit hook
173 173 A dira/dirb/largefile
174 174 $ cd dira
175 175 $ hg cp dirb/largefile foo/largefile
176 176 $ hg ci -m "deep copy"
177 177 Invoking status precommit hook
178 178 A dira/foo/largefile
179 179 $ find . | sort
180 180 .
181 181 ./dirb
182 182 ./dirb/largefile
183 183 ./foo
184 184 ./foo/largefile
185 185 $ hg mv foo/largefile baz/largefile
186 186 $ hg ci -m "moved"
187 187 Invoking status precommit hook
188 188 A dira/baz/largefile
189 189 R dira/foo/largefile
190 190 $ find . | sort
191 191 .
192 192 ./baz
193 193 ./baz/largefile
194 194 ./dirb
195 195 ./dirb/largefile
196 196 ./foo
197 197 $ cd ../../a
198 198
199 199 #if hgweb
200 200 Test display of largefiles in hgweb
201 201
202 202 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
203 203 $ cat ../hg.pid >> $DAEMON_PIDS
204 204 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw'
205 205 200 Script output follows
206
207
206
207
208 208 drwxr-xr-x sub
209 209 -rw-r--r-- 41 large3
210 210 -rw-r--r-- 9 normal3
211
212
211
212
213 213 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw'
214 214 200 Script output follows
215
216
215
216
217 217 -rw-r--r-- 41 large4
218 218 -rw-r--r-- 9 normal4
219
220
219
220
221 221 $ "$TESTDIR/killdaemons.py"
222 222 #endif
223 223
224 224 Test archiving the various revisions. These hit corner cases known with
225 225 archiving.
226 226
227 227 $ hg archive -r 0 ../archive0
228 228 $ hg archive -r 1 ../archive1
229 229 $ hg archive -r 2 ../archive2
230 230 $ hg archive -r 3 ../archive3
231 231 $ hg archive -r 4 ../archive4
232 232 $ cd ../archive0
233 $ cat normal1
233 $ cat normal1
234 234 normal1
235 235 $ cat large1
236 236 large1
237 237 $ cat sub/normal2
238 238 normal2
239 239 $ cat sub/large2
240 240 large2
241 241 $ cd ../archive1
242 242 $ cat normal1
243 243 normal11
244 244 $ cat large1
245 245 large11
246 246 $ cat sub/normal2
247 247 normal22
248 248 $ cat sub/large2
249 249 large22
250 250 $ cd ../archive2
251 251 $ ls
252 252 sub
253 253 $ cat sub/normal2
254 254 normal22
255 255 $ cat sub/large2
256 256 large22
257 257 $ cd ../archive3
258 258 $ cat normal1
259 259 normal22
260 260 $ cat large1
261 261 large22
262 262 $ cat sub/normal2
263 263 normal22
264 264 $ cat sub/large2
265 265 large22
266 266 $ cd ../archive4
267 267 $ cat normal3
268 268 normal22
269 269 $ cat large3
270 270 large22
271 271 $ cat sub/normal4
272 272 normal22
273 273 $ cat sub/large4
274 274 large22
275 275
276 276 Commit corner case: specify files to commit.
277 277
278 278 $ cd ../a
279 279 $ echo normal3 > normal3
280 280 $ echo large3 > large3
281 281 $ echo normal4 > sub/normal4
282 282 $ echo large4 > sub/large4
283 283 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
284 284 Invoking status precommit hook
285 285 M large3
286 286 M normal3
287 287 M sub/large4
288 288 M sub/normal4
289 289 $ cat normal3
290 290 normal3
291 291 $ cat large3
292 292 large3
293 293 $ cat sub/normal4
294 294 normal4
295 295 $ cat sub/large4
296 296 large4
297 297
298 298 One more commit corner case: commit from a subdirectory.
299 299
300 300 $ cd ../a
301 301 $ echo normal33 > normal3
302 302 $ echo large33 > large3
303 303 $ echo normal44 > sub/normal4
304 304 $ echo large44 > sub/large4
305 305 $ cd sub
306 306 $ hg commit -m "edit files yet again"
307 307 Invoking status precommit hook
308 308 M large3
309 309 M normal3
310 310 M sub/large4
311 311 M sub/normal4
312 312 $ cat ../normal3
313 313 normal33
314 314 $ cat ../large3
315 315 large33
316 316 $ cat normal4
317 317 normal44
318 318 $ cat large4
319 319 large44
320 320
321 321 Committing standins is not allowed.
322 322
323 323 $ cd ..
324 324 $ echo large3 > large3
325 325 $ hg commit .hglf/large3 -m "try to commit standin"
326 326 abort: file ".hglf/large3" is a largefile standin
327 327 (commit the largefile itself instead)
328 328 [255]
329 329
330 330 Corner cases for adding largefiles.
331 331
332 332 $ echo large5 > large5
333 333 $ hg add --large large5
334 334 $ hg add --large large5
335 335 large5 already a largefile
336 336 $ mkdir sub2
337 337 $ echo large6 > sub2/large6
338 338 $ echo large7 > sub2/large7
339 339 $ hg add --large sub2
340 340 adding sub2/large6 as a largefile (glob)
341 341 adding sub2/large7 as a largefile (glob)
342 342 $ hg st
343 343 M large3
344 344 A large5
345 345 A sub2/large6
346 346 A sub2/large7
347 347
348 348 Test "hg status" with combination of 'file pattern' and 'directory
349 349 pattern' for largefiles:
350 350
351 351 $ hg status sub2/large6 sub2
352 352 A sub2/large6
353 353 A sub2/large7
354 354
355 355 Config settings (pattern **.dat, minsize 2 MB) are respected.
356 356
357 357 $ echo testdata > test.dat
358 358 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
359 359 $ hg add
360 360 adding reallylarge as a largefile
361 361 adding test.dat as a largefile
362 362
363 363 Test that minsize and --lfsize handle float values;
364 364 also tests that --lfsize overrides largefiles.minsize.
365 365 (0.250 MB = 256 kB = 262144 B)
366 366
367 367 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
368 368 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
369 369 $ hg --config largefiles.minsize=.25 add
370 370 adding ratherlarge as a largefile
371 371 adding medium
372 372 $ hg forget medium
373 373 $ hg --config largefiles.minsize=.25 add --lfsize=.125
374 374 adding medium as a largefile
375 375 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
376 376 $ hg --config largefiles.minsize=.25 add --lfsize=.125
377 377 adding notlarge
378 378 $ hg forget notlarge
379 379
380 380 Test forget on largefiles.
381 381
382 382 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
383 383 $ hg commit -m "add/edit more largefiles"
384 384 Invoking status precommit hook
385 385 A sub2/large6
386 386 A sub2/large7
387 387 R large3
388 388 ? large5
389 389 ? medium
390 390 ? notlarge
391 391 ? ratherlarge
392 392 ? reallylarge
393 393 ? test.dat
394 394 $ hg st
395 395 ? large3
396 396 ? large5
397 397 ? medium
398 398 ? notlarge
399 399 ? ratherlarge
400 400 ? reallylarge
401 401 ? test.dat
402 402
403 403 Purge with largefiles: verify that largefiles are still in the working
404 404 dir after a purge.
405 405
406 406 $ hg purge --all
407 407 $ cat sub/large4
408 408 large44
409 409 $ cat sub2/large6
410 410 large6
411 411 $ cat sub2/large7
412 412 large7
413 413
414 414 Test addremove: verify that files that should be added as largfiles are added as
415 415 such and that already-existing largfiles are not added as normal files by
416 416 accident.
417 417
418 418 $ rm normal3
419 419 $ rm sub/large4
420 420 $ echo "testing addremove with patterns" > testaddremove.dat
421 421 $ echo "normaladdremove" > normaladdremove
422 422 $ hg addremove
423 423 removing sub/large4
424 424 adding testaddremove.dat as a largefile
425 425 removing normal3
426 426 adding normaladdremove
427 427
428 428 Test addremove with -R
429 429
430 430 $ hg up -C
431 431 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
432 432 getting changed largefiles
433 433 1 largefiles updated, 0 removed
434 434 $ rm normal3
435 435 $ rm sub/large4
436 436 $ echo "testing addremove with patterns" > testaddremove.dat
437 437 $ echo "normaladdremove" > normaladdremove
438 438 $ cd ..
439 439 $ hg -R a addremove
440 440 removing sub/large4
441 441 adding a/testaddremove.dat as a largefile (glob)
442 442 removing normal3
443 443 adding normaladdremove
444 444 $ cd a
445 445
446 446 Test 3364
447 447 $ hg clone . ../addrm
448 448 updating to branch default
449 449 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
450 450 getting changed largefiles
451 451 3 largefiles updated, 0 removed
452 452 $ cd ../addrm
453 453 $ cat >> .hg/hgrc <<EOF
454 454 > [hooks]
455 455 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
456 456 > EOF
457 457 $ touch foo
458 458 $ hg add --large foo
459 459 $ hg ci -m "add foo"
460 460 Invoking status precommit hook
461 461 A foo
462 462 Invoking status postcommit hook
463 463 C foo
464 464 C normal3
465 465 C sub/large4
466 466 C sub/normal4
467 467 C sub2/large6
468 468 C sub2/large7
469 469 $ rm foo
470 470 $ hg st
471 471 ! foo
472 472 hmm.. no precommit invoked, but there is a postcommit??
473 473 $ hg ci -m "will not checkin"
474 474 nothing changed
475 475 Invoking status postcommit hook
476 476 ! foo
477 477 C normal3
478 478 C sub/large4
479 479 C sub/normal4
480 480 C sub2/large6
481 481 C sub2/large7
482 482 [1]
483 483 $ hg addremove
484 484 removing foo
485 485 $ hg st
486 486 R foo
487 487 $ hg ci -m "used to say nothing changed"
488 488 Invoking status precommit hook
489 489 R foo
490 490 Invoking status postcommit hook
491 491 C normal3
492 492 C sub/large4
493 493 C sub/normal4
494 494 C sub2/large6
495 495 C sub2/large7
496 496 $ hg st
497 497
498 498 Test 3507 (both normal files and largefiles were a problem)
499 499
500 500 $ touch normal
501 501 $ touch large
502 502 $ hg add normal
503 503 $ hg add --large large
504 504 $ hg ci -m "added"
505 505 Invoking status precommit hook
506 506 A large
507 507 A normal
508 508 Invoking status postcommit hook
509 509 C large
510 510 C normal
511 511 C normal3
512 512 C sub/large4
513 513 C sub/normal4
514 514 C sub2/large6
515 515 C sub2/large7
516 516 $ hg remove normal
517 517 $ hg addremove --traceback
518 518 $ hg ci -m "addremoved normal"
519 519 Invoking status precommit hook
520 520 R normal
521 521 Invoking status postcommit hook
522 522 C large
523 523 C normal3
524 524 C sub/large4
525 525 C sub/normal4
526 526 C sub2/large6
527 527 C sub2/large7
528 528 $ hg up -C '.^'
529 529 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
530 530 getting changed largefiles
531 531 0 largefiles updated, 0 removed
532 532 $ hg remove large
533 533 $ hg addremove --traceback
534 534 $ hg ci -m "removed large"
535 535 Invoking status precommit hook
536 536 R large
537 537 created new head
538 538 Invoking status postcommit hook
539 539 C normal
540 540 C normal3
541 541 C sub/large4
542 542 C sub/normal4
543 543 C sub2/large6
544 544 C sub2/large7
545 545
546 546 Test that a standin can't be added as a large file
547 547
548 548 $ touch large
549 549 $ hg add --large large
550 550 $ hg ci -m "add"
551 551 Invoking status precommit hook
552 552 A large
553 553 Invoking status postcommit hook
554 554 C large
555 555 C normal
556 556 C normal3
557 557 C sub/large4
558 558 C sub/normal4
559 559 C sub2/large6
560 560 C sub2/large7
561 561 $ hg remove large
562 562 $ touch large
563 563 $ hg addremove --config largefiles.patterns=**large --traceback
564 564 adding large as a largefile
565 565
566 566 Test that outgoing --large works (with revsets too)
567 567 $ hg outgoing --rev '.^' --large
568 568 comparing with $TESTTMP/a (glob)
569 569 searching for changes
570 570 changeset: 8:c02fd3b77ec4
571 571 user: test
572 572 date: Thu Jan 01 00:00:00 1970 +0000
573 573 summary: add foo
574 574
575 575 changeset: 9:289dd08c9bbb
576 576 user: test
577 577 date: Thu Jan 01 00:00:00 1970 +0000
578 578 summary: used to say nothing changed
579 579
580 580 changeset: 10:34f23ac6ac12
581 581 user: test
582 582 date: Thu Jan 01 00:00:00 1970 +0000
583 583 summary: added
584 584
585 585 changeset: 12:710c1b2f523c
586 586 parent: 10:34f23ac6ac12
587 587 user: test
588 588 date: Thu Jan 01 00:00:00 1970 +0000
589 589 summary: removed large
590 590
591 591 searching for changes
592 592 largefiles to upload:
593 593 large
594 594 foo
595 595
596 596 $ cd ../a
597 597
598 598 Clone a largefiles repo.
599 599
600 600 $ hg clone . ../b
601 601 updating to branch default
602 602 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
603 603 getting changed largefiles
604 604 3 largefiles updated, 0 removed
605 605 $ cd ../b
606 606 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
607 607 7:daea875e9014 add/edit more largefiles
608 608 6:4355d653f84f edit files yet again
609 609 5:9d5af5072dbd edit files again
610 610 4:74c02385b94c move files
611 611 3:9e8fbc4bce62 copy files
612 612 2:51a0ae4d5864 remove files
613 613 1:ce8896473775 edit files
614 614 0:30d30fe6a5be add files
615 615 $ cat normal3
616 616 normal33
617 617 $ cat sub/normal4
618 618 normal44
619 619 $ cat sub/large4
620 620 large44
621 621 $ cat sub2/large6
622 622 large6
623 623 $ cat sub2/large7
624 624 large7
625 625 $ cd ..
626 626 $ hg clone a -r 3 c
627 627 adding changesets
628 628 adding manifests
629 629 adding file changes
630 630 added 4 changesets with 10 changes to 4 files
631 631 updating to branch default
632 632 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
633 633 getting changed largefiles
634 634 2 largefiles updated, 0 removed
635 635 $ cd c
636 636 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
637 637 3:9e8fbc4bce62 copy files
638 638 2:51a0ae4d5864 remove files
639 639 1:ce8896473775 edit files
640 640 0:30d30fe6a5be add files
641 641 $ cat normal1
642 642 normal22
643 643 $ cat large1
644 644 large22
645 645 $ cat sub/normal2
646 646 normal22
647 647 $ cat sub/large2
648 648 large22
649 649
650 650 Old revisions of a clone have correct largefiles content (this also
651 651 tests update).
652 652
653 $ hg update -r 1
653 $ hg update -r 1
654 654 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
655 655 getting changed largefiles
656 656 1 largefiles updated, 0 removed
657 657 $ cat large1
658 658 large11
659 659 $ cat sub/large2
660 660 large22
661 661 $ cd ..
662 662
663 663 Test cloning with --all-largefiles flag
664 664
665 665 $ rm "${USERCACHE}"/*
666 666 $ hg clone --all-largefiles a a-backup
667 667 updating to branch default
668 668 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
669 669 getting changed largefiles
670 670 3 largefiles updated, 0 removed
671 671 8 additional largefiles cached
672 672
673 673 $ hg clone --all-largefiles a ssh://localhost/a
674 674 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
675 675 [255]
676 676
677 677 Test pulling with --all-largefiles flag
678 678
679 679 $ rm -Rf a-backup
680 680 $ hg clone -r 1 a a-backup
681 681 adding changesets
682 682 adding manifests
683 683 adding file changes
684 684 added 2 changesets with 8 changes to 4 files
685 685 updating to branch default
686 686 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
687 687 getting changed largefiles
688 688 2 largefiles updated, 0 removed
689 689 $ rm "${USERCACHE}"/*
690 690 $ cd a-backup
691 691 $ hg pull --all-largefiles
692 692 pulling from $TESTTMP/a (glob)
693 693 searching for changes
694 694 adding changesets
695 695 adding manifests
696 696 adding file changes
697 697 added 6 changesets with 16 changes to 8 files
698 698 (run 'hg update' to get a working copy)
699 699 caching new largefiles
700 700 3 largefiles cached
701 701 3 additional largefiles cached
702 702 $ cd ..
703 703
704 704 Rebasing between two repositories does not revert largefiles to old
705 705 revisions (this was a very bad bug that took a lot of work to fix).
706 706
707 707 $ hg clone a d
708 708 updating to branch default
709 709 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
710 710 getting changed largefiles
711 711 3 largefiles updated, 0 removed
712 712 $ cd b
713 713 $ echo large4-modified > sub/large4
714 714 $ echo normal3-modified > normal3
715 715 $ hg commit -m "modify normal file and largefile in repo b"
716 716 Invoking status precommit hook
717 717 M normal3
718 718 M sub/large4
719 719 $ cd ../d
720 720 $ echo large6-modified > sub2/large6
721 721 $ echo normal4-modified > sub/normal4
722 722 $ hg commit -m "modify normal file largefile in repo d"
723 723 Invoking status precommit hook
724 724 M sub/normal4
725 725 M sub2/large6
726 726 $ cd ..
727 727 $ hg clone d e
728 728 updating to branch default
729 729 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
730 730 getting changed largefiles
731 731 3 largefiles updated, 0 removed
732 732 $ cd d
733 733 $ hg pull --rebase ../b
734 734 pulling from ../b
735 735 searching for changes
736 736 adding changesets
737 737 adding manifests
738 738 adding file changes
739 739 added 1 changesets with 2 changes to 2 files (+1 heads)
740 740 Invoking status precommit hook
741 741 M sub/normal4
742 742 M sub2/large6
743 743 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
744 744 nothing to rebase
745 745 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
746 746 9:598410d3eb9a modify normal file largefile in repo d
747 747 8:a381d2c8c80e modify normal file and largefile in repo b
748 748 7:daea875e9014 add/edit more largefiles
749 749 6:4355d653f84f edit files yet again
750 750 5:9d5af5072dbd edit files again
751 751 4:74c02385b94c move files
752 752 3:9e8fbc4bce62 copy files
753 753 2:51a0ae4d5864 remove files
754 754 1:ce8896473775 edit files
755 755 0:30d30fe6a5be add files
756 756 $ cat normal3
757 757 normal3-modified
758 758 $ cat sub/normal4
759 759 normal4-modified
760 760 $ cat sub/large4
761 761 large4-modified
762 762 $ cat sub2/large6
763 763 large6-modified
764 764 $ cat sub2/large7
765 765 large7
766 766 $ cd ../e
767 767 $ hg pull ../b
768 768 pulling from ../b
769 769 searching for changes
770 770 adding changesets
771 771 adding manifests
772 772 adding file changes
773 773 added 1 changesets with 2 changes to 2 files (+1 heads)
774 774 (run 'hg heads' to see heads, 'hg merge' to merge)
775 775 caching new largefiles
776 776 0 largefiles cached
777 777 $ hg rebase
778 778 Invoking status precommit hook
779 779 M sub/normal4
780 780 M sub2/large6
781 781 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
782 782 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
783 783 9:598410d3eb9a modify normal file largefile in repo d
784 784 8:a381d2c8c80e modify normal file and largefile in repo b
785 785 7:daea875e9014 add/edit more largefiles
786 786 6:4355d653f84f edit files yet again
787 787 5:9d5af5072dbd edit files again
788 788 4:74c02385b94c move files
789 789 3:9e8fbc4bce62 copy files
790 790 2:51a0ae4d5864 remove files
791 791 1:ce8896473775 edit files
792 792 0:30d30fe6a5be add files
793 793 $ cat normal3
794 794 normal3-modified
795 795 $ cat sub/normal4
796 796 normal4-modified
797 797 $ cat sub/large4
798 798 large4-modified
799 799 $ cat sub2/large6
800 800 large6-modified
801 801 $ cat sub2/large7
802 802 large7
803 803
804 804 Rollback on largefiles.
805 805
806 $ echo large4-modified-again > sub/large4
806 $ echo large4-modified-again > sub/large4
807 807 $ hg commit -m "Modify large4 again"
808 808 Invoking status precommit hook
809 809 M sub/large4
810 810 $ hg rollback
811 811 repository tip rolled back to revision 9 (undo commit)
812 812 working directory now based on revision 9
813 813 $ hg st
814 814 M sub/large4
815 815 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
816 816 9:598410d3eb9a modify normal file largefile in repo d
817 817 8:a381d2c8c80e modify normal file and largefile in repo b
818 818 7:daea875e9014 add/edit more largefiles
819 819 6:4355d653f84f edit files yet again
820 820 5:9d5af5072dbd edit files again
821 821 4:74c02385b94c move files
822 822 3:9e8fbc4bce62 copy files
823 823 2:51a0ae4d5864 remove files
824 824 1:ce8896473775 edit files
825 825 0:30d30fe6a5be add files
826 826 $ cat sub/large4
827 827 large4-modified-again
828 828
829 829 "update --check" refuses to update with uncommitted changes.
830 830 $ hg update --check 8
831 831 abort: uncommitted local changes
832 832 [255]
833 833
834 834 "update --clean" leaves correct largefiles in working copy.
835 835
836 $ hg update --clean
836 $ hg update --clean
837 837 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
838 838 getting changed largefiles
839 839 1 largefiles updated, 0 removed
840 840 $ cat normal3
841 841 normal3-modified
842 842 $ cat sub/normal4
843 843 normal4-modified
844 844 $ cat sub/large4
845 845 large4-modified
846 846 $ cat sub2/large6
847 847 large6-modified
848 848 $ cat sub2/large7
849 849 large7
850 850
851 851 Now "update check" is happy.
852 852 $ hg update --check 8
853 853 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
854 854 getting changed largefiles
855 855 1 largefiles updated, 0 removed
856 856 $ hg update --check
857 857 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
858 858 getting changed largefiles
859 859 1 largefiles updated, 0 removed
860 860
861 861 Test removing empty largefiles directories on update
862 862 $ test -d sub2 && echo "sub2 exists"
863 863 sub2 exists
864 864 $ hg update -q null
865 865 $ test -d sub2 && echo "error: sub2 should not exist anymore"
866 866 [1]
867 867 $ hg update -q
868 868
869 869 Test hg remove removes empty largefiles directories
870 870 $ test -d sub2 && echo "sub2 exists"
871 871 sub2 exists
872 872 $ hg remove sub2/*
873 873 $ test -d sub2 && echo "error: sub2 should not exist anymore"
874 874 [1]
875 875 $ hg revert sub2/large6 sub2/large7
876 876
877 877 "revert" works on largefiles (and normal files too).
878 878 $ echo hack3 >> normal3
879 879 $ echo hack4 >> sub/normal4
880 880 $ echo hack4 >> sub/large4
881 881 $ rm sub2/large6
882 882 $ hg revert sub2/large6
883 883 $ hg rm sub2/large6
884 884 $ echo new >> sub2/large8
885 885 $ hg add --large sub2/large8
886 886 # XXX we don't really want to report that we're reverting the standin;
887 887 # that's just an implementation detail. But I don't see an obvious fix. ;-(
888 888 $ hg revert sub
889 889 reverting .hglf/sub/large4 (glob)
890 890 reverting sub/normal4 (glob)
891 891 $ hg status
892 892 M normal3
893 893 A sub2/large8
894 894 R sub2/large6
895 895 ? sub/large4.orig
896 896 ? sub/normal4.orig
897 897 $ cat sub/normal4
898 898 normal4-modified
899 899 $ cat sub/large4
900 900 large4-modified
901 901 $ hg revert -a --no-backup
902 902 undeleting .hglf/sub2/large6 (glob)
903 903 forgetting .hglf/sub2/large8 (glob)
904 904 reverting normal3
905 905 $ hg status
906 906 ? sub/large4.orig
907 907 ? sub/normal4.orig
908 908 ? sub2/large8
909 909 $ cat normal3
910 910 normal3-modified
911 911 $ cat sub2/large6
912 912 large6-modified
913 913 $ rm sub/*.orig sub2/large8
914 914
915 915 revert some files to an older revision
916 916 $ hg revert --no-backup -r 8 sub2
917 917 reverting .hglf/sub2/large6 (glob)
918 918 $ cat sub2/large6
919 919 large6
920 920 $ hg revert --no-backup -C -r '.^' sub2
921 921 reverting .hglf/sub2/large6 (glob)
922 922 $ hg revert --no-backup sub2
923 923 reverting .hglf/sub2/large6 (glob)
924 924 $ hg status
925 925
926 926 "verify --large" actually verifies largefiles
927 927
928 928 $ hg verify --large
929 929 checking changesets
930 930 checking manifests
931 931 crosschecking files in changesets and manifests
932 932 checking files
933 933 10 files, 10 changesets, 28 total revisions
934 934 searching 1 changesets for largefiles
935 935 verified existence of 3 revisions of 3 largefiles
936 936
937 937 Merging does not revert to old versions of largefiles and also check
938 938 that merging after having pulled from a non-default remote works
939 939 correctly.
940 940
941 941 $ cd ..
942 942 $ hg clone -r 7 e temp
943 943 adding changesets
944 944 adding manifests
945 945 adding file changes
946 946 added 8 changesets with 24 changes to 10 files
947 947 updating to branch default
948 948 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
949 949 getting changed largefiles
950 950 3 largefiles updated, 0 removed
951 951 $ hg clone temp f
952 952 updating to branch default
953 953 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
954 954 getting changed largefiles
955 955 3 largefiles updated, 0 removed
956 956 # Delete the largefiles in the largefiles system cache so that we have an
957 957 # opportunity to test that caching after a pull works.
958 958 $ rm "${USERCACHE}"/*
959 959 $ cd f
960 960 $ echo "large4-merge-test" > sub/large4
961 961 $ hg commit -m "Modify large4 to test merge"
962 962 Invoking status precommit hook
963 963 M sub/large4
964 964 $ hg pull ../e
965 965 pulling from ../e
966 966 searching for changes
967 967 adding changesets
968 968 adding manifests
969 969 adding file changes
970 970 added 2 changesets with 4 changes to 4 files (+1 heads)
971 971 (run 'hg heads' to see heads, 'hg merge' to merge)
972 972 caching new largefiles
973 973 2 largefiles cached
974 974 $ hg merge
975 975 merging sub/large4
976 976 largefile sub/large4 has a merge conflict
977 977 keep (l)ocal or take (o)ther? l
978 978 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
979 979 (branch merge, don't forget to commit)
980 980 getting changed largefiles
981 981 1 largefiles updated, 0 removed
982 982 $ hg commit -m "Merge repos e and f"
983 983 Invoking status precommit hook
984 984 M normal3
985 985 M sub/normal4
986 986 M sub2/large6
987 987 $ cat normal3
988 988 normal3-modified
989 989 $ cat sub/normal4
990 990 normal4-modified
991 991 $ cat sub/large4
992 992 large4-merge-test
993 993 $ cat sub2/large6
994 994 large6-modified
995 995 $ cat sub2/large7
996 996 large7
997 997
998 998 Test status after merging with a branch that introduces a new largefile:
999 999
1000 1000 $ echo large > large
1001 1001 $ hg add --large large
1002 1002 $ hg commit -m 'add largefile'
1003 1003 Invoking status precommit hook
1004 1004 A large
1005 1005 $ hg update -q ".^"
1006 1006 $ echo change >> normal3
1007 1007 $ hg commit -m 'some change'
1008 1008 Invoking status precommit hook
1009 1009 M normal3
1010 1010 created new head
1011 1011 $ hg merge
1012 1012 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1013 1013 (branch merge, don't forget to commit)
1014 1014 getting changed largefiles
1015 1015 1 largefiles updated, 0 removed
1016 1016 $ hg status
1017 1017 M large
1018 1018
1019 1019 Test that a normal file and a largefile with the same name and path cannot
1020 1020 coexist.
1021 1021
1022 1022 $ rm sub2/large7
1023 1023 $ echo "largeasnormal" > sub2/large7
1024 1024 $ hg add sub2/large7
1025 1025 sub2/large7 already a largefile
1026 1026
1027 1027 Test that transplanting a largefile change works correctly.
1028 1028
1029 1029 $ cd ..
1030 1030 $ hg clone -r 8 d g
1031 1031 adding changesets
1032 1032 adding manifests
1033 1033 adding file changes
1034 1034 added 9 changesets with 26 changes to 10 files
1035 1035 updating to branch default
1036 1036 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1037 1037 getting changed largefiles
1038 1038 3 largefiles updated, 0 removed
1039 1039 $ cd g
1040 $ hg transplant -s ../d 598410d3eb9a
1040 $ hg transplant -s ../d 598410d3eb9a
1041 1041 searching for changes
1042 1042 searching for changes
1043 1043 adding changesets
1044 1044 adding manifests
1045 1045 adding file changes
1046 1046 added 1 changesets with 2 changes to 2 files
1047 1047 getting changed largefiles
1048 1048 1 largefiles updated, 0 removed
1049 1049 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1050 1050 9:598410d3eb9a modify normal file largefile in repo d
1051 1051 8:a381d2c8c80e modify normal file and largefile in repo b
1052 1052 7:daea875e9014 add/edit more largefiles
1053 1053 6:4355d653f84f edit files yet again
1054 1054 5:9d5af5072dbd edit files again
1055 1055 4:74c02385b94c move files
1056 1056 3:9e8fbc4bce62 copy files
1057 1057 2:51a0ae4d5864 remove files
1058 1058 1:ce8896473775 edit files
1059 1059 0:30d30fe6a5be add files
1060 1060 $ cat normal3
1061 1061 normal3-modified
1062 1062 $ cat sub/normal4
1063 1063 normal4-modified
1064 1064 $ cat sub/large4
1065 1065 large4-modified
1066 1066 $ cat sub2/large6
1067 1067 large6-modified
1068 1068 $ cat sub2/large7
1069 1069 large7
1070 1070
1071 1071 Cat a largefile
1072 1072 $ hg cat normal3
1073 1073 normal3-modified
1074 1074 $ hg cat sub/large4
1075 1075 large4-modified
1076 1076 $ rm "${USERCACHE}"/*
1077 1077 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1078 1078 $ cat cat.out
1079 1079 large4-modified
1080 1080 $ rm cat.out
1081 1081 $ hg cat -r a381d2c8c80e normal3
1082 1082 normal3-modified
1083 1083 $ hg cat -r '.^' normal3
1084 1084 normal3-modified
1085 1085 $ hg cat -r '.^' sub/large4
1086 1086 large4-modified
1087 1087
1088 1088 Test that renaming a largefile results in correct output for status
1089 1089
1090 1090 $ hg rename sub/large4 large4-renamed
1091 1091 $ hg commit -m "test rename output"
1092 1092 Invoking status precommit hook
1093 1093 A large4-renamed
1094 1094 R sub/large4
1095 1095 $ cat large4-renamed
1096 1096 large4-modified
1097 1097 $ cd sub2
1098 1098 $ hg rename large6 large6-renamed
1099 1099 $ hg st
1100 1100 A sub2/large6-renamed
1101 1101 R sub2/large6
1102 1102 $ cd ..
1103 1103
1104 1104 Test --normal flag
1105 1105
1106 1106 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1107 1107 $ hg add --normal --large new-largefile
1108 1108 abort: --normal cannot be used with --large
1109 1109 [255]
1110 1110 $ hg add --normal new-largefile
1111 1111 new-largefile: up to 69 MB of RAM may be required to manage this file
1112 1112 (use 'hg revert new-largefile' to cancel the pending addition)
1113 1113 $ cd ..
1114 1114
1115 1115 #if serve
1116 1116 vanilla clients not locked out from largefiles servers on vanilla repos
1117 1117 $ mkdir r1
1118 1118 $ cd r1
1119 1119 $ hg init
1120 1120 $ echo c1 > f1
1121 1121 $ hg add f1
1122 1122 $ hg commit -m "m1"
1123 1123 Invoking status precommit hook
1124 1124 A f1
1125 1125 $ cd ..
1126 1126 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
1127 1127 $ cat hg.pid >> $DAEMON_PIDS
1128 1128 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
1129 1129 requesting all changes
1130 1130 adding changesets
1131 1131 adding manifests
1132 1132 adding file changes
1133 1133 added 1 changesets with 1 changes to 1 files
1134 1134 updating to branch default
1135 1135 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1136 1136
1137 1137 largefiles clients still work with vanilla servers
1138 1138 $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
1139 1139 $ cat hg.pid >> $DAEMON_PIDS
1140 1140 $ hg clone http://localhost:$HGPORT1 r3
1141 1141 requesting all changes
1142 1142 adding changesets
1143 1143 adding manifests
1144 1144 adding file changes
1145 1145 added 1 changesets with 1 changes to 1 files
1146 1146 updating to branch default
1147 1147 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1148 1148 #endif
1149 1149
1150 1150
1151 1151 vanilla clients locked out from largefiles http repos
1152 1152 $ mkdir r4
1153 1153 $ cd r4
1154 1154 $ hg init
1155 1155 $ echo c1 > f1
1156 1156 $ hg add --large f1
1157 1157 $ hg commit -m "m1"
1158 1158 Invoking status precommit hook
1159 1159 A f1
1160 1160 $ cd ..
1161 1161
1162 1162 largefiles can be pushed locally (issue3583)
1163 1163 $ hg init dest
1164 1164 $ cd r4
1165 1165 $ hg outgoing ../dest
1166 1166 comparing with ../dest
1167 1167 searching for changes
1168 1168 changeset: 0:639881c12b4c
1169 1169 tag: tip
1170 1170 user: test
1171 1171 date: Thu Jan 01 00:00:00 1970 +0000
1172 1172 summary: m1
1173 1173
1174 1174 $ hg push ../dest
1175 1175 pushing to ../dest
1176 1176 searching for changes
1177 1177 searching for changes
1178 1178 adding changesets
1179 1179 adding manifests
1180 1180 adding file changes
1181 1181 added 1 changesets with 1 changes to 1 files
1182
1182
1183 1183 exit code with nothing outgoing (issue3611)
1184 1184 $ hg outgoing ../dest
1185 1185 comparing with ../dest
1186 1186 searching for changes
1187 1187 no changes found
1188 1188 [1]
1189 1189 $ cd ..
1190 1190
1191 1191 #if serve
1192 1192 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
1193 1193 $ cat hg.pid >> $DAEMON_PIDS
1194 1194 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
1195 1195 abort: remote error:
1196 1196
1197 1197 This repository uses the largefiles extension.
1198 1198
1199 1199 Please enable it in your Mercurial config file.
1200 1200 [255]
1201 1201
1202 1202 used all HGPORTs, kill all daemons
1203 1203 $ "$TESTDIR/killdaemons.py"
1204 1204 #endif
1205 1205
1206 1206 vanilla clients locked out from largefiles ssh repos
1207 1207 $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
1208 1208 abort: remote error:
1209 1209
1210 1210 This repository uses the largefiles extension.
1211 1211
1212 1212 Please enable it in your Mercurial config file.
1213 1213 [255]
1214 1214
1215 1215 #if serve
1216 1216
1217 1217 largefiles clients refuse to push largefiles repos to vanilla servers
1218 1218 $ mkdir r6
1219 1219 $ cd r6
1220 1220 $ hg init
1221 1221 $ echo c1 > f1
1222 1222 $ hg add f1
1223 1223 $ hg commit -m "m1"
1224 1224 Invoking status precommit hook
1225 1225 A f1
1226 1226 $ cat >> .hg/hgrc <<!
1227 1227 > [web]
1228 1228 > push_ssl = false
1229 1229 > allow_push = *
1230 1230 > !
1231 1231 $ cd ..
1232 1232 $ hg clone r6 r7
1233 1233 updating to branch default
1234 1234 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1235 1235 $ cd r7
1236 1236 $ echo c2 > f2
1237 1237 $ hg add --large f2
1238 1238 $ hg commit -m "m2"
1239 1239 Invoking status precommit hook
1240 1240 A f2
1241 1241 $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
1242 1242 $ cat ../hg.pid >> $DAEMON_PIDS
1243 1243 $ hg push http://localhost:$HGPORT
1244 1244 pushing to http://localhost:$HGPORT/
1245 1245 searching for changes
1246 1246 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
1247 1247 [255]
1248 1248 $ cd ..
1249 1249
1250 1250 putlfile errors are shown (issue3123)
1251 1251 Corrupt the cached largefile in r7 and in the usercache (required for testing on vfat)
1252 1252 $ echo corruption > "$TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8"
1253 1253 $ echo corruption > "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
1254 1254 $ hg init empty
1255 1255 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
1256 1256 > --config 'web.allow_push=*' --config web.push_ssl=False
1257 1257 $ cat hg.pid >> $DAEMON_PIDS
1258 1258 $ hg push -R r7 http://localhost:$HGPORT1
1259 1259 pushing to http://localhost:$HGPORT1/
1260 1260 searching for changes
1261 1261 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
1262 1262 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
1263 1263 [255]
1264 1264 $ rm -rf empty
1265 1265
1266 1266 Push a largefiles repository to a served empty repository
1267 1267 $ hg init r8
1268 1268 $ echo c3 > r8/f1
1269 1269 $ hg add --large r8/f1 -R r8
1270 1270 $ hg commit -m "m1" -R r8
1271 1271 Invoking status precommit hook
1272 1272 A f1
1273 1273 $ hg init empty
1274 1274 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
1275 1275 > --config 'web.allow_push=*' --config web.push_ssl=False
1276 1276 $ cat hg.pid >> $DAEMON_PIDS
1277 1277 $ rm "${USERCACHE}"/*
1278 1278 $ hg push -R r8 http://localhost:$HGPORT2
1279 1279 pushing to http://localhost:$HGPORT2/
1280 1280 searching for changes
1281 1281 searching for changes
1282 1282 remote: adding changesets
1283 1283 remote: adding manifests
1284 1284 remote: adding file changes
1285 1285 remote: added 1 changesets with 1 changes to 1 files
1286 1286 $ rm -rf empty
1287 1287
1288 1288 used all HGPORTs, kill all daemons
1289 1289 $ "$TESTDIR/killdaemons.py"
1290 1290
1291 1291 #endif
1292 1292
1293 1293
1294 1294 #if unix-permissions
1295 1295
1296 1296 Clone a local repository owned by another user
1297 1297 We have to simulate that here by setting $HOME and removing write permissions
1298 1298 $ ORIGHOME="$HOME"
1299 1299 $ mkdir alice
1300 1300 $ HOME="`pwd`/alice"
1301 1301 $ cd alice
1302 1302 $ hg init pubrepo
1303 1303 $ cd pubrepo
1304 1304 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
1305 1305 $ hg add --large a-large-file
1306 1306 $ hg commit -m "Add a large file"
1307 1307 Invoking status precommit hook
1308 1308 A a-large-file
1309 1309 $ cd ..
1310 1310 $ chmod -R a-w pubrepo
1311 1311 $ cd ..
1312 1312 $ mkdir bob
1313 1313 $ HOME="`pwd`/bob"
1314 1314 $ cd bob
1315 1315 $ hg clone --pull ../alice/pubrepo pubrepo
1316 1316 requesting all changes
1317 1317 adding changesets
1318 1318 adding manifests
1319 1319 adding file changes
1320 1320 added 1 changesets with 1 changes to 1 files
1321 1321 updating to branch default
1322 1322 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1323 1323 getting changed largefiles
1324 1324 1 largefiles updated, 0 removed
1325 1325 $ cd ..
1326 1326 $ chmod -R u+w alice/pubrepo
1327 1327 $ HOME="$ORIGHOME"
1328 1328
1329 1329 #endif
1330 1330
1331 1331 #if symlink
1332 1332
1333 1333 Symlink to a large largefile should behave the same as a symlink to a normal file
1334 1334 $ hg init largesymlink
1335 1335 $ cd largesymlink
1336 1336 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
1337 1337 $ hg add --large largefile
1338 1338 $ hg commit -m "commit a large file"
1339 1339 Invoking status precommit hook
1340 1340 A largefile
1341 1341 $ ln -s largefile largelink
1342 1342 $ hg add largelink
1343 1343 $ hg commit -m "commit a large symlink"
1344 1344 Invoking status precommit hook
1345 1345 A largelink
1346 1346 $ rm -f largelink
1347 1347 $ hg up >/dev/null
1348 1348 $ test -f largelink
1349 1349 [1]
1350 1350 $ test -L largelink
1351 1351 [1]
1352 1352 $ rm -f largelink # make next part of the test independent of the previous
1353 1353 $ hg up -C >/dev/null
1354 1354 $ test -f largelink
1355 1355 $ test -L largelink
1356 1356 $ cd ..
1357 1357
1358 1358 #endif
1359 1359
1360 1360 test for pattern matching on 'hg status':
1361 1361 to boost performance, largefiles checks whether specified patterns are
1362 1362 related to largefiles in working directory (NOT to STANDIN) or not.
1363 1363
1364 1364 $ hg init statusmatch
1365 1365 $ cd statusmatch
1366 1366
1367 1367 $ mkdir -p a/b/c/d
1368 1368 $ echo normal > a/b/c/d/e.normal.txt
1369 1369 $ hg add a/b/c/d/e.normal.txt
1370 1370 $ echo large > a/b/c/d/e.large.txt
1371 1371 $ hg add --large a/b/c/d/e.large.txt
1372 1372 $ mkdir -p a/b/c/x
1373 1373 $ echo normal > a/b/c/x/y.normal.txt
1374 1374 $ hg add a/b/c/x/y.normal.txt
1375 1375 $ hg commit -m 'add files'
1376 1376 Invoking status precommit hook
1377 1377 A a/b/c/d/e.large.txt
1378 1378 A a/b/c/d/e.normal.txt
1379 1379 A a/b/c/x/y.normal.txt
1380 1380
1381 1381 (1) no pattern: no performance boost
1382 1382 $ hg status -A
1383 1383 C a/b/c/d/e.large.txt
1384 1384 C a/b/c/d/e.normal.txt
1385 1385 C a/b/c/x/y.normal.txt
1386 1386
1387 1387 (2) pattern not related to largefiles: performance boost
1388 1388 $ hg status -A a/b/c/x
1389 1389 C a/b/c/x/y.normal.txt
1390 1390
1391 1391 (3) pattern related to largefiles: no performance boost
1392 1392 $ hg status -A a/b/c/d
1393 1393 C a/b/c/d/e.large.txt
1394 1394 C a/b/c/d/e.normal.txt
1395 1395
1396 1396 (4) pattern related to STANDIN (not to largefiles): performance boost
1397 1397 $ hg status -A .hglf/a
1398 1398 C .hglf/a/b/c/d/e.large.txt
1399 1399
1400 1400 (5) mixed case: no performance boost
1401 1401 $ hg status -A a/b/c/x a/b/c/d
1402 1402 C a/b/c/d/e.large.txt
1403 1403 C a/b/c/d/e.normal.txt
1404 1404 C a/b/c/x/y.normal.txt
1405 1405
1406 1406 verify that largefiles doesn't break filesets
1407 1407
1408 1408 $ hg log --rev . --exclude "set:binary()"
1409 1409 changeset: 0:41bd42f10efa
1410 1410 tag: tip
1411 1411 user: test
1412 1412 date: Thu Jan 01 00:00:00 1970 +0000
1413 1413 summary: add files
1414 1414
1415 1415 verify that large files in subrepos handled properly
1416 1416 $ hg init subrepo
1417 1417 $ echo "subrepo = subrepo" > .hgsub
1418 1418 $ hg add .hgsub
1419 1419 $ hg ci -m "add subrepo"
1420 1420 Invoking status precommit hook
1421 1421 A .hgsub
1422 1422 ? .hgsubstate
1423 1423 $ echo "rev 1" > subrepo/large.txt
1424 1424 $ hg -R subrepo add --large subrepo/large.txt
1425 1425 $ hg sum
1426 1426 parent: 1:8ee150ea2e9c tip
1427 1427 add subrepo
1428 1428 branch: default
1429 1429 commit: 1 subrepos
1430 1430 update: (current)
1431 1431 $ hg st
1432 1432 $ hg st -S
1433 1433 A subrepo/large.txt
1434 1434 $ hg ci -S -m "commit top repo"
1435 1435 committing subrepository subrepo
1436 1436 Invoking status precommit hook
1437 1437 A large.txt
1438 1438 Invoking status precommit hook
1439 1439 M .hgsubstate
1440 1440 # No differences
1441 1441 $ hg st -S
1442 1442 $ hg sum
1443 1443 parent: 2:ce4cd0c527a6 tip
1444 1444 commit top repo
1445 1445 branch: default
1446 1446 commit: (clean)
1447 1447 update: (current)
1448 1448 $ echo "rev 2" > subrepo/large.txt
1449 1449 $ hg st -S
1450 1450 M subrepo/large.txt
1451 1451 $ hg sum
1452 1452 parent: 2:ce4cd0c527a6 tip
1453 1453 commit top repo
1454 1454 branch: default
1455 1455 commit: 1 subrepos
1456 1456 update: (current)
1457 1457 $ hg ci -m "this commit should fail without -S"
1458 1458 abort: uncommitted changes in subrepo subrepo
1459 1459 (use --subrepos for recursive commit)
1460 1460 [255]
1461 1461
1462 1462 Add a normal file to the subrepo, then test archiving
1463 1463
1464 1464 $ echo 'normal file' > subrepo/normal.txt
1465 1465 $ hg -R subrepo add subrepo/normal.txt
1466 1466
1467 1467 Lock in subrepo, otherwise the change isn't archived
1468 1468
1469 1469 $ hg ci -S -m "add normal file to top level"
1470 1470 committing subrepository subrepo
1471 1471 Invoking status precommit hook
1472 1472 M large.txt
1473 1473 A normal.txt
1474 1474 Invoking status precommit hook
1475 1475 M .hgsubstate
1476 1476 $ hg archive -S lf_subrepo_archive
1477 1477 $ find lf_subrepo_archive | sort
1478 1478 lf_subrepo_archive
1479 1479 lf_subrepo_archive/.hg_archival.txt
1480 1480 lf_subrepo_archive/.hgsub
1481 1481 lf_subrepo_archive/.hgsubstate
1482 1482 lf_subrepo_archive/a
1483 1483 lf_subrepo_archive/a/b
1484 1484 lf_subrepo_archive/a/b/c
1485 1485 lf_subrepo_archive/a/b/c/d
1486 1486 lf_subrepo_archive/a/b/c/d/e.large.txt
1487 1487 lf_subrepo_archive/a/b/c/d/e.normal.txt
1488 1488 lf_subrepo_archive/a/b/c/x
1489 1489 lf_subrepo_archive/a/b/c/x/y.normal.txt
1490 1490 lf_subrepo_archive/subrepo
1491 1491 lf_subrepo_archive/subrepo/large.txt
1492 1492 lf_subrepo_archive/subrepo/normal.txt
1493 1493
1494 1494 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now