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