##// END OF EJS Templates
test: split test-largefile.t in multiple file...
Pierre-Yves David -
r21424:d13b4ecd default
parent child Browse files
Show More
This diff has been collapsed as it changes many lines, (696 lines changed) Show them Hide them
@@ -0,0 +1,696 b''
1 This file contains testcases that tend to be related to special cases or less
2 common commands affecting largefile.
3
4 Each sections should be independent of each others.
5
6 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
7 $ mkdir "${USERCACHE}"
8 $ cat >> $HGRCPATH <<EOF
9 > [extensions]
10 > largefiles=
11 > purge=
12 > rebase=
13 > transplant=
14 > [phases]
15 > publish=False
16 > [largefiles]
17 > minsize=2
18 > patterns=glob:**.dat
19 > usercache=${USERCACHE}
20 > [hooks]
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
22 > EOF
23
24
25
26 Test copies and moves from a directory other than root (issue3516)
27 =========================================================================
28
29 $ hg init lf_cpmv
30 $ cd lf_cpmv
31 $ mkdir dira
32 $ mkdir dira/dirb
33 $ touch dira/dirb/largefile
34 $ hg add --large dira/dirb/largefile
35 $ hg commit -m "added"
36 Invoking status precommit hook
37 A dira/dirb/largefile
38 $ cd dira
39 $ hg cp dirb/largefile foo/largefile
40 $ hg ci -m "deep copy"
41 Invoking status precommit hook
42 A dira/foo/largefile
43 $ find . | sort
44 .
45 ./dirb
46 ./dirb/largefile
47 ./foo
48 ./foo/largefile
49 $ hg mv foo/largefile baz/largefile
50 $ hg ci -m "moved"
51 Invoking status precommit hook
52 A dira/baz/largefile
53 R dira/foo/largefile
54 $ find . | sort
55 .
56 ./baz
57 ./baz/largefile
58 ./dirb
59 ./dirb/largefile
60 $ cd ..
61 $ hg mv dira dirc
62 moving .hglf/dira/baz/largefile to .hglf/dirc/baz/largefile (glob)
63 moving .hglf/dira/dirb/largefile to .hglf/dirc/dirb/largefile (glob)
64 $ find * | sort
65 dirc
66 dirc/baz
67 dirc/baz/largefile
68 dirc/dirb
69 dirc/dirb/largefile
70 $ hg up -qC
71 $ cd ..
72
73 Clone a local repository owned by another user
74 ===================================================
75
76 #if unix-permissions
77
78 We have to simulate that here by setting $HOME and removing write permissions
79 $ ORIGHOME="$HOME"
80 $ mkdir alice
81 $ HOME="`pwd`/alice"
82 $ cd alice
83 $ hg init pubrepo
84 $ cd pubrepo
85 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
86 $ hg add --large a-large-file
87 $ hg commit -m "Add a large file"
88 Invoking status precommit hook
89 A a-large-file
90 $ cd ..
91 $ chmod -R a-w pubrepo
92 $ cd ..
93 $ mkdir bob
94 $ HOME="`pwd`/bob"
95 $ cd bob
96 $ hg clone --pull ../alice/pubrepo pubrepo
97 requesting all changes
98 adding changesets
99 adding manifests
100 adding file changes
101 added 1 changesets with 1 changes to 1 files
102 updating to branch default
103 getting changed largefiles
104 1 largefiles updated, 0 removed
105 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
106 $ cd ..
107 $ chmod -R u+w alice/pubrepo
108 $ HOME="$ORIGHOME"
109
110 #endif
111
112
113 Symlink to a large largefile should behave the same as a symlink to a normal file
114 =====================================================================================
115
116 #if symlink
117
118 $ hg init largesymlink
119 $ cd largesymlink
120 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
121 $ hg add --large largefile
122 $ hg commit -m "commit a large file"
123 Invoking status precommit hook
124 A largefile
125 $ ln -s largefile largelink
126 $ hg add largelink
127 $ hg commit -m "commit a large symlink"
128 Invoking status precommit hook
129 A largelink
130 $ rm -f largelink
131 $ hg up >/dev/null
132 $ test -f largelink
133 [1]
134 $ test -L largelink
135 [1]
136 $ rm -f largelink # make next part of the test independent of the previous
137 $ hg up -C >/dev/null
138 $ test -f largelink
139 $ test -L largelink
140 $ cd ..
141
142 #endif
143
144
145 test for pattern matching on 'hg status':
146 ==============================================
147
148
149 to boost performance, largefiles checks whether specified patterns are
150 related to largefiles in working directory (NOT to STANDIN) or not.
151
152 $ hg init statusmatch
153 $ cd statusmatch
154
155 $ mkdir -p a/b/c/d
156 $ echo normal > a/b/c/d/e.normal.txt
157 $ hg add a/b/c/d/e.normal.txt
158 $ echo large > a/b/c/d/e.large.txt
159 $ hg add --large a/b/c/d/e.large.txt
160 $ mkdir -p a/b/c/x
161 $ echo normal > a/b/c/x/y.normal.txt
162 $ hg add a/b/c/x/y.normal.txt
163 $ hg commit -m 'add files'
164 Invoking status precommit hook
165 A a/b/c/d/e.large.txt
166 A a/b/c/d/e.normal.txt
167 A a/b/c/x/y.normal.txt
168
169 (1) no pattern: no performance boost
170 $ hg status -A
171 C a/b/c/d/e.large.txt
172 C a/b/c/d/e.normal.txt
173 C a/b/c/x/y.normal.txt
174
175 (2) pattern not related to largefiles: performance boost
176 $ hg status -A a/b/c/x
177 C a/b/c/x/y.normal.txt
178
179 (3) pattern related to largefiles: no performance boost
180 $ hg status -A a/b/c/d
181 C a/b/c/d/e.large.txt
182 C a/b/c/d/e.normal.txt
183
184 (4) pattern related to STANDIN (not to largefiles): performance boost
185 $ hg status -A .hglf/a
186 C .hglf/a/b/c/d/e.large.txt
187
188 (5) mixed case: no performance boost
189 $ hg status -A a/b/c/x a/b/c/d
190 C a/b/c/d/e.large.txt
191 C a/b/c/d/e.normal.txt
192 C a/b/c/x/y.normal.txt
193
194 verify that largefiles doesn't break filesets
195
196 $ hg log --rev . --exclude "set:binary()"
197 changeset: 0:41bd42f10efa
198 tag: tip
199 user: test
200 date: Thu Jan 01 00:00:00 1970 +0000
201 summary: add files
202
203 verify that large files in subrepos handled properly
204 $ hg init subrepo
205 $ echo "subrepo = subrepo" > .hgsub
206 $ hg add .hgsub
207 $ hg ci -m "add subrepo"
208 Invoking status precommit hook
209 A .hgsub
210 ? .hgsubstate
211 $ echo "rev 1" > subrepo/large.txt
212 $ hg -R subrepo add --large subrepo/large.txt
213 $ hg sum
214 parent: 1:8ee150ea2e9c tip
215 add subrepo
216 branch: default
217 commit: 1 subrepos
218 update: (current)
219 $ hg st
220 $ hg st -S
221 A subrepo/large.txt
222 $ hg ci -S -m "commit top repo"
223 committing subrepository subrepo
224 Invoking status precommit hook
225 A large.txt
226 Invoking status precommit hook
227 M .hgsubstate
228 # No differences
229 $ hg st -S
230 $ hg sum
231 parent: 2:ce4cd0c527a6 tip
232 commit top repo
233 branch: default
234 commit: (clean)
235 update: (current)
236 $ echo "rev 2" > subrepo/large.txt
237 $ hg st -S
238 M subrepo/large.txt
239 $ hg sum
240 parent: 2:ce4cd0c527a6 tip
241 commit top repo
242 branch: default
243 commit: 1 subrepos
244 update: (current)
245 $ hg ci -m "this commit should fail without -S"
246 abort: uncommitted changes in subrepo subrepo
247 (use --subrepos for recursive commit)
248 [255]
249
250 Add a normal file to the subrepo, then test archiving
251
252 $ echo 'normal file' > subrepo/normal.txt
253 $ hg -R subrepo add subrepo/normal.txt
254
255 Lock in subrepo, otherwise the change isn't archived
256
257 $ hg ci -S -m "add normal file to top level"
258 committing subrepository subrepo
259 Invoking status precommit hook
260 M large.txt
261 A normal.txt
262 Invoking status precommit hook
263 M .hgsubstate
264 $ hg archive -S ../lf_subrepo_archive
265 $ find ../lf_subrepo_archive | sort
266 ../lf_subrepo_archive
267 ../lf_subrepo_archive/.hg_archival.txt
268 ../lf_subrepo_archive/.hgsub
269 ../lf_subrepo_archive/.hgsubstate
270 ../lf_subrepo_archive/a
271 ../lf_subrepo_archive/a/b
272 ../lf_subrepo_archive/a/b/c
273 ../lf_subrepo_archive/a/b/c/d
274 ../lf_subrepo_archive/a/b/c/d/e.large.txt
275 ../lf_subrepo_archive/a/b/c/d/e.normal.txt
276 ../lf_subrepo_archive/a/b/c/x
277 ../lf_subrepo_archive/a/b/c/x/y.normal.txt
278 ../lf_subrepo_archive/subrepo
279 ../lf_subrepo_archive/subrepo/large.txt
280 ../lf_subrepo_archive/subrepo/normal.txt
281
282 Test update with subrepos.
283
284 $ hg update 0
285 getting changed largefiles
286 0 largefiles updated, 1 removed
287 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
288 $ hg status -S
289 $ hg update tip
290 getting changed largefiles
291 1 largefiles updated, 0 removed
292 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
293 $ hg status -S
294 # modify a large file
295 $ echo "modified" > subrepo/large.txt
296 $ hg st -S
297 M subrepo/large.txt
298 # update -C should revert the change.
299 $ hg update -C
300 getting changed largefiles
301 1 largefiles updated, 0 removed
302 getting changed largefiles
303 0 largefiles updated, 0 removed
304 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
305 $ hg status -S
306
307 Test archiving a revision that references a subrepo that is not yet
308 cloned (see test-subrepo-recursion.t):
309
310 $ hg clone -U . ../empty
311 $ cd ../empty
312 $ hg archive --subrepos -r tip ../archive.tar.gz
313 cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
314 $ cd ..
315
316
317
318
319
320
321 Test addremove, forget and others
322 ==============================================
323
324 Test that addremove picks up largefiles prior to the initial commit (issue3541)
325
326 $ hg init addrm2
327 $ cd addrm2
328 $ touch large.dat
329 $ touch large2.dat
330 $ touch normal
331 $ hg add --large large.dat
332 $ hg addremove -v
333 adding large2.dat as a largefile
334 adding normal
335
336 Test that forgetting all largefiles reverts to islfilesrepo() == False
337 (addremove will add *.dat as normal files now)
338 $ hg forget large.dat
339 $ hg forget large2.dat
340 $ hg addremove -v
341 adding large.dat
342 adding large2.dat
343
344 Test commit's addremove option prior to the first commit
345 $ hg forget large.dat
346 $ hg forget large2.dat
347 $ hg add --large large.dat
348 $ hg ci -Am "commit"
349 adding large2.dat as a largefile
350 Invoking status precommit hook
351 A large.dat
352 A large2.dat
353 A normal
354 $ find .hglf | sort
355 .hglf
356 .hglf/large.dat
357 .hglf/large2.dat
358
359 Test actions on largefiles using relative paths from subdir
360
361 $ mkdir sub
362 $ cd sub
363 $ echo anotherlarge > anotherlarge
364 $ hg add --large anotherlarge
365 $ hg st
366 A sub/anotherlarge
367 $ hg st anotherlarge
368 A anotherlarge
369 $ hg commit -m anotherlarge anotherlarge
370 Invoking status precommit hook
371 A sub/anotherlarge
372 $ hg log anotherlarge
373 changeset: 1:9627a577c5e9
374 tag: tip
375 user: test
376 date: Thu Jan 01 00:00:00 1970 +0000
377 summary: anotherlarge
378
379 $ hg log -G anotherlarge
380 @ changeset: 1:9627a577c5e9
381 | tag: tip
382 | user: test
383 | date: Thu Jan 01 00:00:00 1970 +0000
384 | summary: anotherlarge
385 |
386 $ echo more >> anotherlarge
387 $ hg st .
388 M anotherlarge
389 $ hg cat anotherlarge
390 anotherlarge
391 $ hg revert anotherlarge
392 $ hg st
393 ? sub/anotherlarge.orig
394 $ cd ..
395
396 $ cd ..
397
398 Check error message while exchange
399 =========================================================
400
401 issue3651: summary/outgoing with largefiles shows "no remote repo"
402 unexpectedly
403
404 $ mkdir issue3651
405 $ cd issue3651
406
407 $ hg init src
408 $ echo a > src/a
409 $ hg -R src add --large src/a
410 $ hg -R src commit -m '#0'
411 Invoking status precommit hook
412 A a
413
414 check messages when no remote repository is specified:
415 "no remote repo" route for "hg outgoing --large" is not tested here,
416 because it can't be reproduced easily.
417
418 $ hg init clone1
419 $ hg -R clone1 -q pull src
420 $ hg -R clone1 -q update
421 $ hg -R clone1 paths | grep default
422 [1]
423
424 $ hg -R clone1 summary --large
425 parent: 0:fc0bd45326d3 tip
426 #0
427 branch: default
428 commit: (clean)
429 update: (current)
430 largefiles: (no remote repo)
431
432 check messages when there is no files to upload:
433
434 $ hg -q clone src clone2
435 $ hg -R clone2 paths | grep default
436 default = $TESTTMP/issue3651/src (glob)
437
438 $ hg -R clone2 summary --large
439 parent: 0:fc0bd45326d3 tip
440 #0
441 branch: default
442 commit: (clean)
443 update: (current)
444 largefiles: (no files to upload)
445 $ hg -R clone2 outgoing --large
446 comparing with $TESTTMP/issue3651/src (glob)
447 searching for changes
448 no changes found
449 largefiles: no files to upload
450 [1]
451
452 $ hg -R clone2 outgoing --large --graph --template "{rev}"
453 comparing with $TESTTMP/issue3651/src (glob)
454 searching for changes
455 no changes found
456 largefiles: no files to upload
457
458 check messages when there are files to upload:
459
460 $ echo b > clone2/b
461 $ hg -R clone2 add --large clone2/b
462 $ hg -R clone2 commit -m '#1'
463 Invoking status precommit hook
464 A b
465 $ hg -R clone2 summary --large
466 parent: 1:1acbe71ce432 tip
467 #1
468 branch: default
469 commit: (clean)
470 update: (current)
471 largefiles: 1 to upload
472 $ hg -R clone2 outgoing --large
473 comparing with $TESTTMP/issue3651/src (glob)
474 searching for changes
475 changeset: 1:1acbe71ce432
476 tag: tip
477 user: test
478 date: Thu Jan 01 00:00:00 1970 +0000
479 summary: #1
480
481 largefiles to upload:
482 b
483
484 $ hg -R clone2 outgoing --large --graph --template "{rev}"
485 comparing with $TESTTMP/issue3651/src
486 searching for changes
487 @ 1
488
489 largefiles to upload:
490 b
491
492
493 $ cd ..
494
495 merge action 'd' for 'local renamed directory to d2/g' which has no filename
496 ==================================================================================
497
498 $ hg init merge-action
499 $ cd merge-action
500 $ touch l
501 $ hg add --large l
502 $ mkdir d1
503 $ touch d1/f
504 $ hg ci -Aqm0
505 Invoking status precommit hook
506 A d1/f
507 A l
508 $ echo > d1/f
509 $ touch d1/g
510 $ hg ci -Aqm1
511 Invoking status precommit hook
512 M d1/f
513 A d1/g
514 $ hg up -qr0
515 $ hg mv d1 d2
516 moving d1/f to d2/f (glob)
517 $ hg ci -qm2
518 Invoking status precommit hook
519 A d2/f
520 R d1/f
521 $ hg merge
522 merging d2/f and d1/f to d2/f
523 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
524 (branch merge, don't forget to commit)
525 getting changed largefiles
526 0 largefiles updated, 0 removed
527 $ cd ..
528
529
530 Merge conflicts:
531 =====================
532
533 $ hg init merge
534 $ cd merge
535 $ echo 0 > f-different
536 $ echo 0 > f-same
537 $ echo 0 > f-unchanged-1
538 $ echo 0 > f-unchanged-2
539 $ hg add --large *
540 $ hg ci -m0
541 Invoking status precommit hook
542 A f-different
543 A f-same
544 A f-unchanged-1
545 A f-unchanged-2
546 $ echo tmp1 > f-unchanged-1
547 $ echo tmp1 > f-unchanged-2
548 $ echo tmp1 > f-same
549 $ hg ci -m1
550 Invoking status precommit hook
551 M f-same
552 M f-unchanged-1
553 M f-unchanged-2
554 $ echo 2 > f-different
555 $ echo 0 > f-unchanged-1
556 $ echo 1 > f-unchanged-2
557 $ echo 1 > f-same
558 $ hg ci -m2
559 Invoking status precommit hook
560 M f-different
561 M f-same
562 M f-unchanged-1
563 M f-unchanged-2
564 $ hg up -qr0
565 $ echo tmp2 > f-unchanged-1
566 $ echo tmp2 > f-unchanged-2
567 $ echo tmp2 > f-same
568 $ hg ci -m3
569 Invoking status precommit hook
570 M f-same
571 M f-unchanged-1
572 M f-unchanged-2
573 created new head
574 $ echo 1 > f-different
575 $ echo 1 > f-unchanged-1
576 $ echo 0 > f-unchanged-2
577 $ echo 1 > f-same
578 $ hg ci -m4
579 Invoking status precommit hook
580 M f-different
581 M f-same
582 M f-unchanged-1
583 M f-unchanged-2
584 $ hg merge
585 largefile f-different has a merge conflict
586 ancestor was 09d2af8dd22201dd8d48e5dcfcaed281ff9422c7
587 keep (l)ocal e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e or
588 take (o)ther 7448d8798a4380162d4b56f9b452e2f6f9e24e7a? l
589 0 files updated, 4 files merged, 0 files removed, 0 files unresolved
590 (branch merge, don't forget to commit)
591 getting changed largefiles
592 1 largefiles updated, 0 removed
593 $ cat f-different
594 1
595 $ cat f-same
596 1
597 $ cat f-unchanged-1
598 1
599 $ cat f-unchanged-2
600 1
601 $ cd ..
602
603 Test largefile insulation (do not enabled a side effect
604 ========================================================
605
606 Check whether "largefiles" feature is supported only in repositories
607 enabling largefiles extension.
608
609 $ mkdir individualenabling
610 $ cd individualenabling
611
612 $ hg init enabledlocally
613 $ echo large > enabledlocally/large
614 $ hg -R enabledlocally add --large enabledlocally/large
615 $ hg -R enabledlocally commit -m '#0'
616 Invoking status precommit hook
617 A large
618
619 $ hg init notenabledlocally
620 $ echo large > notenabledlocally/large
621 $ hg -R notenabledlocally add --large notenabledlocally/large
622 $ hg -R notenabledlocally commit -m '#0'
623 Invoking status precommit hook
624 A large
625
626 $ cat >> $HGRCPATH <<EOF
627 > [extensions]
628 > # disable globally
629 > largefiles=!
630 > EOF
631 $ cat >> enabledlocally/.hg/hgrc <<EOF
632 > [extensions]
633 > # enable locally
634 > largefiles=
635 > EOF
636 $ hg -R enabledlocally root
637 $TESTTMP/individualenabling/enabledlocally (glob)
638 $ hg -R notenabledlocally root
639 abort: repository requires features unknown to this Mercurial: largefiles!
640 (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
641 [255]
642
643 $ hg init push-dst
644 $ hg -R enabledlocally push push-dst
645 pushing to push-dst
646 abort: required features are not supported in the destination: largefiles
647 [255]
648
649 $ hg init pull-src
650 $ hg -R pull-src pull enabledlocally
651 pulling from enabledlocally
652 abort: required features are not supported in the destination: largefiles
653 [255]
654
655 $ hg clone enabledlocally clone-dst
656 abort: repository requires features unknown to this Mercurial: largefiles!
657 (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
658 [255]
659 $ test -d clone-dst
660 [1]
661 $ hg clone --pull enabledlocally clone-pull-dst
662 abort: required features are not supported in the destination: largefiles
663 [255]
664 $ test -d clone-pull-dst
665 [1]
666
667 #if serve
668
669 Test largefiles specific peer setup, when largefiles is enabled
670 locally (issue4109)
671
672 $ hg showconfig extensions | grep largefiles
673 extensions.largefiles=!
674 $ mkdir -p $TESTTMP/individualenabling/usercache
675
676 $ hg serve -R enabledlocally -d -p $HGPORT --pid-file hg.pid
677 $ cat hg.pid >> $DAEMON_PIDS
678
679 $ hg init pull-dst
680 $ cat > pull-dst/.hg/hgrc <<EOF
681 > [extensions]
682 > # enable locally
683 > largefiles=
684 > [largefiles]
685 > # ignore system cache to force largefiles specific wire proto access
686 > usercache=$TESTTMP/individualenabling/usercache
687 > EOF
688 $ hg -R pull-dst -q pull -u http://localhost:$HGPORT
689
690 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
691 #endif
692
693 $ cd ..
694
695
696
@@ -0,0 +1,293 b''
1 This file contains testcases that tend to be related to the wireprotocol part of
2 largefile.
3
4 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
5 $ mkdir "${USERCACHE}"
6 $ cat >> $HGRCPATH <<EOF
7 > [extensions]
8 > largefiles=
9 > purge=
10 > rebase=
11 > transplant=
12 > [phases]
13 > publish=False
14 > [largefiles]
15 > minsize=2
16 > patterns=glob:**.dat
17 > usercache=${USERCACHE}
18 > [hooks]
19 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
20 > EOF
21
22
23 #if serve
24 vanilla clients not locked out from largefiles servers on vanilla repos
25 $ mkdir r1
26 $ cd r1
27 $ hg init
28 $ echo c1 > f1
29 $ hg add f1
30 $ hg commit -m "m1"
31 Invoking status precommit hook
32 A f1
33 $ cd ..
34 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
35 $ cat hg.pid >> $DAEMON_PIDS
36 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
37 requesting all changes
38 adding changesets
39 adding manifests
40 adding file changes
41 added 1 changesets with 1 changes to 1 files
42 updating to branch default
43 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
44
45 largefiles clients still work with vanilla servers
46 $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
47 $ cat hg.pid >> $DAEMON_PIDS
48 $ hg clone http://localhost:$HGPORT1 r3
49 requesting all changes
50 adding changesets
51 adding manifests
52 adding file changes
53 added 1 changesets with 1 changes to 1 files
54 updating to branch default
55 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
56 #endif
57
58 vanilla clients locked out from largefiles http repos
59 $ mkdir r4
60 $ cd r4
61 $ hg init
62 $ echo c1 > f1
63 $ hg add --large f1
64 $ hg commit -m "m1"
65 Invoking status precommit hook
66 A f1
67 $ cd ..
68
69 largefiles can be pushed locally (issue3583)
70 $ hg init dest
71 $ cd r4
72 $ hg outgoing ../dest
73 comparing with ../dest
74 searching for changes
75 changeset: 0:639881c12b4c
76 tag: tip
77 user: test
78 date: Thu Jan 01 00:00:00 1970 +0000
79 summary: m1
80
81 $ hg push ../dest
82 pushing to ../dest
83 searching for changes
84 adding changesets
85 adding manifests
86 adding file changes
87 added 1 changesets with 1 changes to 1 files
88
89 exit code with nothing outgoing (issue3611)
90 $ hg outgoing ../dest
91 comparing with ../dest
92 searching for changes
93 no changes found
94 [1]
95 $ cd ..
96
97 #if serve
98 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
99 $ cat hg.pid >> $DAEMON_PIDS
100 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
101 abort: remote error:
102
103 This repository uses the largefiles extension.
104
105 Please enable it in your Mercurial config file.
106 [255]
107
108 used all HGPORTs, kill all daemons
109 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
110 #endif
111
112 vanilla clients locked out from largefiles ssh repos
113 $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
114 abort: remote error:
115
116 This repository uses the largefiles extension.
117
118 Please enable it in your Mercurial config file.
119 [255]
120
121 #if serve
122
123 largefiles clients refuse to push largefiles repos to vanilla servers
124 $ mkdir r6
125 $ cd r6
126 $ hg init
127 $ echo c1 > f1
128 $ hg add f1
129 $ hg commit -m "m1"
130 Invoking status precommit hook
131 A f1
132 $ cat >> .hg/hgrc <<!
133 > [web]
134 > push_ssl = false
135 > allow_push = *
136 > !
137 $ cd ..
138 $ hg clone r6 r7
139 updating to branch default
140 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
141 $ cd r7
142 $ echo c2 > f2
143 $ hg add --large f2
144 $ hg commit -m "m2"
145 Invoking status precommit hook
146 A f2
147 $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
148 $ cat ../hg.pid >> $DAEMON_PIDS
149 $ hg push http://localhost:$HGPORT
150 pushing to http://localhost:$HGPORT/
151 searching for changes
152 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
153 [255]
154 $ cd ..
155
156 putlfile errors are shown (issue3123)
157 Corrupt the cached largefile in r7 and move it out of the servers usercache
158 $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 .
159 $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
160 $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
161 $ hg init empty
162 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
163 > --config 'web.allow_push=*' --config web.push_ssl=False
164 $ cat hg.pid >> $DAEMON_PIDS
165 $ hg push -R r7 http://localhost:$HGPORT1
166 pushing to http://localhost:$HGPORT1/
167 searching for changes
168 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
169 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
170 [255]
171 $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
172 Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic
173 $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
174 $ hg push -R r7 http://localhost:$HGPORT1
175 pushing to http://localhost:$HGPORT1/
176 searching for changes
177 remote: adding changesets
178 remote: adding manifests
179 remote: adding file changes
180 remote: added 2 changesets with 2 changes to 2 files
181 $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
182 server side corruption
183 $ rm -rf empty
184
185 Push a largefiles repository to a served empty repository
186 $ hg init r8
187 $ echo c3 > r8/f1
188 $ hg add --large r8/f1 -R r8
189 $ hg commit -m "m1" -R r8
190 Invoking status precommit hook
191 A f1
192 $ hg init empty
193 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
194 > --config 'web.allow_push=*' --config web.push_ssl=False
195 $ cat hg.pid >> $DAEMON_PIDS
196 $ rm "${USERCACHE}"/*
197 $ hg push -R r8 http://localhost:$HGPORT2/#default
198 pushing to http://localhost:$HGPORT2/
199 searching for changes
200 remote: adding changesets
201 remote: adding manifests
202 remote: adding file changes
203 remote: added 1 changesets with 1 changes to 1 files
204 $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
205 $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
206
207 Clone over http, no largefiles pulled on clone.
208
209 $ hg clone http://localhost:$HGPORT2/#default http-clone -U
210 adding changesets
211 adding manifests
212 adding file changes
213 added 1 changesets with 1 changes to 1 files
214
215 test 'verify' with remotestore:
216
217 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
218 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
219 $ hg -R http-clone verify --large --lfa
220 checking changesets
221 checking manifests
222 crosschecking files in changesets and manifests
223 checking files
224 1 files, 1 changesets, 1 total revisions
225 searching 1 changesets for largefiles
226 changeset 0:cf03e5bb9936: f1 missing
227 verified existence of 1 revisions of 1 largefiles
228 [1]
229 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
230 $ hg -R http-clone -q verify --large --lfa
231
232 largefiles pulled on update - a largefile missing on the server:
233 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
234 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
235 getting changed largefiles
236 f1: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 not available from http://localhost:$HGPORT2/
237 0 largefiles updated, 0 removed
238 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
239 $ hg -R http-clone st
240 ! f1
241 $ hg -R http-clone up -Cqr null
242
243 largefiles pulled on update - a largefile corrupted on the server:
244 $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
245 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
246 getting changed largefiles
247 f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
248 0 largefiles updated, 0 removed
249 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
250 $ hg -R http-clone st
251 ! f1
252 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
253 $ [ ! -f http-clone/f1 ]
254 $ [ ! -f http-clone-usercache ]
255 $ hg -R http-clone verify --large --lfc
256 checking changesets
257 checking manifests
258 crosschecking files in changesets and manifests
259 checking files
260 1 files, 1 changesets, 1 total revisions
261 searching 1 changesets for largefiles
262 verified contents of 1 revisions of 1 largefiles
263 $ hg -R http-clone up -Cqr null
264
265 largefiles pulled on update - no server side problems:
266 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
267 $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache
268 resolving manifests
269 branchmerge: False, force: False, partial: False
270 ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936
271 .hglf/f1: remote created -> g
272 getting .hglf/f1
273 updating: .hglf/f1 1/1 files (100.00%)
274 getting changed largefiles
275 using http://localhost:$HGPORT2/
276 sending capabilities command
277 sending batch command
278 getting largefiles: 0/1 lfile (0.00%)
279 getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90
280 sending getlfile command
281 found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
282 1 largefiles updated, 0 removed
283 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
284
285 $ ls http-clone-usercache/*
286 http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
287
288 $ rm -rf empty http-clone*
289
290 used all HGPORTs, kill all daemons
291 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
292
293 #endif
This diff has been collapsed as it changes many lines, (919 lines changed) Show them Hide them
@@ -1,3 +1,8 b''
1 This file used to contains all largefile tests.
2 Do not add any new tests in this file as it his already far too long to run.
3
4 It contains all the testing of the basic concepts of large file in a single block.
5
1 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
6 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
2 $ mkdir "${USERCACHE}"
7 $ mkdir "${USERCACHE}"
3 $ cat >> $HGRCPATH <<EOF
8 $ cat >> $HGRCPATH <<EOF
@@ -180,52 +185,6 b' Test moving largefiles and verify that n'
180 $ cat sub/large4
185 $ cat sub/large4
181 large22
186 large22
182
187
183 Test copies and moves from a directory other than root (issue3516)
184
185 $ cd ..
186 $ hg init lf_cpmv
187 $ cd lf_cpmv
188 $ mkdir dira
189 $ mkdir dira/dirb
190 $ touch dira/dirb/largefile
191 $ hg add --large dira/dirb/largefile
192 $ hg commit -m "added"
193 Invoking status precommit hook
194 A dira/dirb/largefile
195 $ cd dira
196 $ hg cp dirb/largefile foo/largefile
197 $ hg ci -m "deep copy"
198 Invoking status precommit hook
199 A dira/foo/largefile
200 $ find . | sort
201 .
202 ./dirb
203 ./dirb/largefile
204 ./foo
205 ./foo/largefile
206 $ hg mv foo/largefile baz/largefile
207 $ hg ci -m "moved"
208 Invoking status precommit hook
209 A dira/baz/largefile
210 R dira/foo/largefile
211 $ find . | sort
212 .
213 ./baz
214 ./baz/largefile
215 ./dirb
216 ./dirb/largefile
217 $ cd ..
218 $ hg mv dira dirc
219 moving .hglf/dira/baz/largefile to .hglf/dirc/baz/largefile (glob)
220 moving .hglf/dira/dirb/largefile to .hglf/dirc/dirb/largefile (glob)
221 $ find * | sort
222 dirc
223 dirc/baz
224 dirc/baz/largefile
225 dirc/dirb
226 dirc/dirb/largefile
227 $ hg up -qC
228 $ cd ../a
229
188
230 #if serve
189 #if serve
231 Test display of largefiles in hgweb
190 Test display of largefiles in hgweb
@@ -1673,873 +1632,5 b' Test --normal flag'
1673 (use 'hg revert new-largefile' to cancel the pending addition)
1632 (use 'hg revert new-largefile' to cancel the pending addition)
1674 $ cd ..
1633 $ cd ..
1675
1634
1676 #if serve
1677 vanilla clients not locked out from largefiles servers on vanilla repos
1678 $ mkdir r1
1679 $ cd r1
1680 $ hg init
1681 $ echo c1 > f1
1682 $ hg add f1
1683 $ hg commit -m "m1"
1684 Invoking status precommit hook
1685 A f1
1686 $ cd ..
1687 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
1688 $ cat hg.pid >> $DAEMON_PIDS
1689 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
1690 requesting all changes
1691 adding changesets
1692 adding manifests
1693 adding file changes
1694 added 1 changesets with 1 changes to 1 files
1695 updating to branch default
1696 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1697
1698 largefiles clients still work with vanilla servers
1699 $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
1700 $ cat hg.pid >> $DAEMON_PIDS
1701 $ hg clone http://localhost:$HGPORT1 r3
1702 requesting all changes
1703 adding changesets
1704 adding manifests
1705 adding file changes
1706 added 1 changesets with 1 changes to 1 files
1707 updating to branch default
1708 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1709 #endif
1710
1711
1712 vanilla clients locked out from largefiles http repos
1713 $ mkdir r4
1714 $ cd r4
1715 $ hg init
1716 $ echo c1 > f1
1717 $ hg add --large f1
1718 $ hg commit -m "m1"
1719 Invoking status precommit hook
1720 A f1
1721 $ cd ..
1722
1723 largefiles can be pushed locally (issue3583)
1724 $ hg init dest
1725 $ cd r4
1726 $ hg outgoing ../dest
1727 comparing with ../dest
1728 searching for changes
1729 changeset: 0:639881c12b4c
1730 tag: tip
1731 user: test
1732 date: Thu Jan 01 00:00:00 1970 +0000
1733 summary: m1
1734
1735 $ hg push ../dest
1736 pushing to ../dest
1737 searching for changes
1738 adding changesets
1739 adding manifests
1740 adding file changes
1741 added 1 changesets with 1 changes to 1 files
1742
1743 exit code with nothing outgoing (issue3611)
1744 $ hg outgoing ../dest
1745 comparing with ../dest
1746 searching for changes
1747 no changes found
1748 [1]
1749 $ cd ..
1750
1751 #if serve
1752 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
1753 $ cat hg.pid >> $DAEMON_PIDS
1754 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
1755 abort: remote error:
1756
1757 This repository uses the largefiles extension.
1758
1759 Please enable it in your Mercurial config file.
1760 [255]
1761
1762 used all HGPORTs, kill all daemons
1763 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1764 #endif
1765
1766 vanilla clients locked out from largefiles ssh repos
1767 $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
1768 abort: remote error:
1769
1770 This repository uses the largefiles extension.
1771
1772 Please enable it in your Mercurial config file.
1773 [255]
1774
1775 #if serve
1776
1777 largefiles clients refuse to push largefiles repos to vanilla servers
1778 $ mkdir r6
1779 $ cd r6
1780 $ hg init
1781 $ echo c1 > f1
1782 $ hg add f1
1783 $ hg commit -m "m1"
1784 Invoking status precommit hook
1785 A f1
1786 $ cat >> .hg/hgrc <<!
1787 > [web]
1788 > push_ssl = false
1789 > allow_push = *
1790 > !
1791 $ cd ..
1792 $ hg clone r6 r7
1793 updating to branch default
1794 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1795 $ cd r7
1796 $ echo c2 > f2
1797 $ hg add --large f2
1798 $ hg commit -m "m2"
1799 Invoking status precommit hook
1800 A f2
1801 $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
1802 $ cat ../hg.pid >> $DAEMON_PIDS
1803 $ hg push http://localhost:$HGPORT
1804 pushing to http://localhost:$HGPORT/
1805 searching for changes
1806 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
1807 [255]
1808 $ cd ..
1809
1810 putlfile errors are shown (issue3123)
1811 Corrupt the cached largefile in r7 and move it out of the servers usercache
1812 $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 .
1813 $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1814 $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
1815 $ hg init empty
1816 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
1817 > --config 'web.allow_push=*' --config web.push_ssl=False
1818 $ cat hg.pid >> $DAEMON_PIDS
1819 $ hg push -R r7 http://localhost:$HGPORT1
1820 pushing to http://localhost:$HGPORT1/
1821 searching for changes
1822 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
1823 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
1824 [255]
1825 $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1826 Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic
1827 $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1828 $ hg push -R r7 http://localhost:$HGPORT1
1829 pushing to http://localhost:$HGPORT1/
1830 searching for changes
1831 remote: adding changesets
1832 remote: adding manifests
1833 remote: adding file changes
1834 remote: added 2 changesets with 2 changes to 2 files
1835 $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1836 server side corruption
1837 $ rm -rf empty
1838
1839 Push a largefiles repository to a served empty repository
1840 $ hg init r8
1841 $ echo c3 > r8/f1
1842 $ hg add --large r8/f1 -R r8
1843 $ hg commit -m "m1" -R r8
1844 Invoking status precommit hook
1845 A f1
1846 $ hg init empty
1847 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
1848 > --config 'web.allow_push=*' --config web.push_ssl=False
1849 $ cat hg.pid >> $DAEMON_PIDS
1850 $ rm "${USERCACHE}"/*
1851 $ hg push -R r8 http://localhost:$HGPORT2/#default
1852 pushing to http://localhost:$HGPORT2/
1853 searching for changes
1854 remote: adding changesets
1855 remote: adding manifests
1856 remote: adding file changes
1857 remote: added 1 changesets with 1 changes to 1 files
1858 $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1859 $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1860
1861 Clone over http, no largefiles pulled on clone.
1862
1863 $ hg clone http://localhost:$HGPORT2/#default http-clone -U
1864 adding changesets
1865 adding manifests
1866 adding file changes
1867 added 1 changesets with 1 changes to 1 files
1868
1869 test 'verify' with remotestore:
1870
1871 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
1872 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1873 $ hg -R http-clone verify --large --lfa
1874 checking changesets
1875 checking manifests
1876 crosschecking files in changesets and manifests
1877 checking files
1878 1 files, 1 changesets, 1 total revisions
1879 searching 1 changesets for largefiles
1880 changeset 0:cf03e5bb9936: f1 missing
1881 verified existence of 1 revisions of 1 largefiles
1882 [1]
1883 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1884 $ hg -R http-clone -q verify --large --lfa
1885
1886 largefiles pulled on update - a largefile missing on the server:
1887 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1888 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1889 getting changed largefiles
1890 f1: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 not available from http://localhost:$HGPORT2/
1891 0 largefiles updated, 0 removed
1892 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1893 $ hg -R http-clone st
1894 ! f1
1895 $ hg -R http-clone up -Cqr null
1896
1897 largefiles pulled on update - a largefile corrupted on the server:
1898 $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
1899 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1900 getting changed largefiles
1901 f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
1902 0 largefiles updated, 0 removed
1903 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1904 $ hg -R http-clone st
1905 ! f1
1906 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1907 $ [ ! -f http-clone/f1 ]
1908 $ [ ! -f http-clone-usercache ]
1909 $ hg -R http-clone verify --large --lfc
1910 checking changesets
1911 checking manifests
1912 crosschecking files in changesets and manifests
1913 checking files
1914 1 files, 1 changesets, 1 total revisions
1915 searching 1 changesets for largefiles
1916 verified contents of 1 revisions of 1 largefiles
1917 $ hg -R http-clone up -Cqr null
1918
1919 largefiles pulled on update - no server side problems:
1920 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1921 $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache
1922 resolving manifests
1923 branchmerge: False, force: False, partial: False
1924 ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936
1925 .hglf/f1: remote created -> g
1926 getting .hglf/f1
1927 updating: .hglf/f1 1/1 files (100.00%)
1928 getting changed largefiles
1929 using http://localhost:$HGPORT2/
1930 sending capabilities command
1931 sending batch command
1932 getting largefiles: 0/1 lfile (0.00%)
1933 getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90
1934 sending getlfile command
1935 found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
1936 1 largefiles updated, 0 removed
1937 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1938
1939 $ ls http-clone-usercache/*
1940 http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
1941
1942 $ rm -rf empty http-clone*
1943
1944 used all HGPORTs, kill all daemons
1945 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1946
1947 #endif
1948
1635
1949
1636
1950 #if unix-permissions
1951
1952 Clone a local repository owned by another user
1953 We have to simulate that here by setting $HOME and removing write permissions
1954 $ ORIGHOME="$HOME"
1955 $ mkdir alice
1956 $ HOME="`pwd`/alice"
1957 $ cd alice
1958 $ hg init pubrepo
1959 $ cd pubrepo
1960 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
1961 $ hg add --large a-large-file
1962 $ hg commit -m "Add a large file"
1963 Invoking status precommit hook
1964 A a-large-file
1965 $ cd ..
1966 $ chmod -R a-w pubrepo
1967 $ cd ..
1968 $ mkdir bob
1969 $ HOME="`pwd`/bob"
1970 $ cd bob
1971 $ hg clone --pull ../alice/pubrepo pubrepo
1972 requesting all changes
1973 adding changesets
1974 adding manifests
1975 adding file changes
1976 added 1 changesets with 1 changes to 1 files
1977 updating to branch default
1978 getting changed largefiles
1979 1 largefiles updated, 0 removed
1980 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1981 $ cd ..
1982 $ chmod -R u+w alice/pubrepo
1983 $ HOME="$ORIGHOME"
1984
1985 #endif
1986
1987 #if symlink
1988
1989 Symlink to a large largefile should behave the same as a symlink to a normal file
1990 $ hg init largesymlink
1991 $ cd largesymlink
1992 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
1993 $ hg add --large largefile
1994 $ hg commit -m "commit a large file"
1995 Invoking status precommit hook
1996 A largefile
1997 $ ln -s largefile largelink
1998 $ hg add largelink
1999 $ hg commit -m "commit a large symlink"
2000 Invoking status precommit hook
2001 A largelink
2002 $ rm -f largelink
2003 $ hg up >/dev/null
2004 $ test -f largelink
2005 [1]
2006 $ test -L largelink
2007 [1]
2008 $ rm -f largelink # make next part of the test independent of the previous
2009 $ hg up -C >/dev/null
2010 $ test -f largelink
2011 $ test -L largelink
2012 $ cd ..
2013
2014 #endif
2015
2016 test for pattern matching on 'hg status':
2017 to boost performance, largefiles checks whether specified patterns are
2018 related to largefiles in working directory (NOT to STANDIN) or not.
2019
2020 $ hg init statusmatch
2021 $ cd statusmatch
2022
2023 $ mkdir -p a/b/c/d
2024 $ echo normal > a/b/c/d/e.normal.txt
2025 $ hg add a/b/c/d/e.normal.txt
2026 $ echo large > a/b/c/d/e.large.txt
2027 $ hg add --large a/b/c/d/e.large.txt
2028 $ mkdir -p a/b/c/x
2029 $ echo normal > a/b/c/x/y.normal.txt
2030 $ hg add a/b/c/x/y.normal.txt
2031 $ hg commit -m 'add files'
2032 Invoking status precommit hook
2033 A a/b/c/d/e.large.txt
2034 A a/b/c/d/e.normal.txt
2035 A a/b/c/x/y.normal.txt
2036
2037 (1) no pattern: no performance boost
2038 $ hg status -A
2039 C a/b/c/d/e.large.txt
2040 C a/b/c/d/e.normal.txt
2041 C a/b/c/x/y.normal.txt
2042
2043 (2) pattern not related to largefiles: performance boost
2044 $ hg status -A a/b/c/x
2045 C a/b/c/x/y.normal.txt
2046
2047 (3) pattern related to largefiles: no performance boost
2048 $ hg status -A a/b/c/d
2049 C a/b/c/d/e.large.txt
2050 C a/b/c/d/e.normal.txt
2051
2052 (4) pattern related to STANDIN (not to largefiles): performance boost
2053 $ hg status -A .hglf/a
2054 C .hglf/a/b/c/d/e.large.txt
2055
2056 (5) mixed case: no performance boost
2057 $ hg status -A a/b/c/x a/b/c/d
2058 C a/b/c/d/e.large.txt
2059 C a/b/c/d/e.normal.txt
2060 C a/b/c/x/y.normal.txt
2061
2062 verify that largefiles doesn't break filesets
2063
2064 $ hg log --rev . --exclude "set:binary()"
2065 changeset: 0:41bd42f10efa
2066 tag: tip
2067 user: test
2068 date: Thu Jan 01 00:00:00 1970 +0000
2069 summary: add files
2070
2071 verify that large files in subrepos handled properly
2072 $ hg init subrepo
2073 $ echo "subrepo = subrepo" > .hgsub
2074 $ hg add .hgsub
2075 $ hg ci -m "add subrepo"
2076 Invoking status precommit hook
2077 A .hgsub
2078 ? .hgsubstate
2079 $ echo "rev 1" > subrepo/large.txt
2080 $ hg -R subrepo add --large subrepo/large.txt
2081 $ hg sum
2082 parent: 1:8ee150ea2e9c tip
2083 add subrepo
2084 branch: default
2085 commit: 1 subrepos
2086 update: (current)
2087 $ hg st
2088 $ hg st -S
2089 A subrepo/large.txt
2090 $ hg ci -S -m "commit top repo"
2091 committing subrepository subrepo
2092 Invoking status precommit hook
2093 A large.txt
2094 Invoking status precommit hook
2095 M .hgsubstate
2096 # No differences
2097 $ hg st -S
2098 $ hg sum
2099 parent: 2:ce4cd0c527a6 tip
2100 commit top repo
2101 branch: default
2102 commit: (clean)
2103 update: (current)
2104 $ echo "rev 2" > subrepo/large.txt
2105 $ hg st -S
2106 M subrepo/large.txt
2107 $ hg sum
2108 parent: 2:ce4cd0c527a6 tip
2109 commit top repo
2110 branch: default
2111 commit: 1 subrepos
2112 update: (current)
2113 $ hg ci -m "this commit should fail without -S"
2114 abort: uncommitted changes in subrepo subrepo
2115 (use --subrepos for recursive commit)
2116 [255]
2117
2118 Add a normal file to the subrepo, then test archiving
2119
2120 $ echo 'normal file' > subrepo/normal.txt
2121 $ hg -R subrepo add subrepo/normal.txt
2122
2123 Lock in subrepo, otherwise the change isn't archived
2124
2125 $ hg ci -S -m "add normal file to top level"
2126 committing subrepository subrepo
2127 Invoking status precommit hook
2128 M large.txt
2129 A normal.txt
2130 Invoking status precommit hook
2131 M .hgsubstate
2132 $ hg archive -S ../lf_subrepo_archive
2133 $ find ../lf_subrepo_archive | sort
2134 ../lf_subrepo_archive
2135 ../lf_subrepo_archive/.hg_archival.txt
2136 ../lf_subrepo_archive/.hgsub
2137 ../lf_subrepo_archive/.hgsubstate
2138 ../lf_subrepo_archive/a
2139 ../lf_subrepo_archive/a/b
2140 ../lf_subrepo_archive/a/b/c
2141 ../lf_subrepo_archive/a/b/c/d
2142 ../lf_subrepo_archive/a/b/c/d/e.large.txt
2143 ../lf_subrepo_archive/a/b/c/d/e.normal.txt
2144 ../lf_subrepo_archive/a/b/c/x
2145 ../lf_subrepo_archive/a/b/c/x/y.normal.txt
2146 ../lf_subrepo_archive/subrepo
2147 ../lf_subrepo_archive/subrepo/large.txt
2148 ../lf_subrepo_archive/subrepo/normal.txt
2149
2150 Test update with subrepos.
2151
2152 $ hg update 0
2153 getting changed largefiles
2154 0 largefiles updated, 1 removed
2155 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
2156 $ hg status -S
2157 $ hg update tip
2158 getting changed largefiles
2159 1 largefiles updated, 0 removed
2160 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
2161 $ hg status -S
2162 # modify a large file
2163 $ echo "modified" > subrepo/large.txt
2164 $ hg st -S
2165 M subrepo/large.txt
2166 # update -C should revert the change.
2167 $ hg update -C
2168 getting changed largefiles
2169 1 largefiles updated, 0 removed
2170 getting changed largefiles
2171 0 largefiles updated, 0 removed
2172 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2173 $ hg status -S
2174
2175 Test archiving a revision that references a subrepo that is not yet
2176 cloned (see test-subrepo-recursion.t):
2177
2178 $ hg clone -U . ../empty
2179 $ cd ../empty
2180 $ hg archive --subrepos -r tip ../archive.tar.gz
2181 cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
2182 $ cd ..
2183
2184 Test that addremove picks up largefiles prior to the initial commit (issue3541)
2185
2186 $ hg init addrm2
2187 $ cd addrm2
2188 $ touch large.dat
2189 $ touch large2.dat
2190 $ touch normal
2191 $ hg add --large large.dat
2192 $ hg addremove -v
2193 adding large2.dat as a largefile
2194 adding normal
2195
2196 Test that forgetting all largefiles reverts to islfilesrepo() == False
2197 (addremove will add *.dat as normal files now)
2198 $ hg forget large.dat
2199 $ hg forget large2.dat
2200 $ hg addremove -v
2201 adding large.dat
2202 adding large2.dat
2203
2204 Test commit's addremove option prior to the first commit
2205 $ hg forget large.dat
2206 $ hg forget large2.dat
2207 $ hg add --large large.dat
2208 $ hg ci -Am "commit"
2209 adding large2.dat as a largefile
2210 Invoking status precommit hook
2211 A large.dat
2212 A large2.dat
2213 A normal
2214 $ find .hglf | sort
2215 .hglf
2216 .hglf/large.dat
2217 .hglf/large2.dat
2218
2219 Test actions on largefiles using relative paths from subdir
2220
2221 $ mkdir sub
2222 $ cd sub
2223 $ echo anotherlarge > anotherlarge
2224 $ hg add --large anotherlarge
2225 $ hg st
2226 A sub/anotherlarge
2227 $ hg st anotherlarge
2228 A anotherlarge
2229 $ hg commit -m anotherlarge anotherlarge
2230 Invoking status precommit hook
2231 A sub/anotherlarge
2232 $ hg log anotherlarge
2233 changeset: 1:9627a577c5e9
2234 tag: tip
2235 user: test
2236 date: Thu Jan 01 00:00:00 1970 +0000
2237 summary: anotherlarge
2238
2239 $ hg log -G anotherlarge
2240 @ changeset: 1:9627a577c5e9
2241 | tag: tip
2242 | user: test
2243 | date: Thu Jan 01 00:00:00 1970 +0000
2244 | summary: anotherlarge
2245 |
2246 $ echo more >> anotherlarge
2247 $ hg st .
2248 M anotherlarge
2249 $ hg cat anotherlarge
2250 anotherlarge
2251 $ hg revert anotherlarge
2252 $ hg st
2253 ? sub/anotherlarge.orig
2254 $ cd ..
2255
2256 $ cd ..
2257
2258 issue3651: summary/outgoing with largefiles shows "no remote repo"
2259 unexpectedly
2260
2261 $ mkdir issue3651
2262 $ cd issue3651
2263
2264 $ hg init src
2265 $ echo a > src/a
2266 $ hg -R src add --large src/a
2267 $ hg -R src commit -m '#0'
2268 Invoking status precommit hook
2269 A a
2270
2271 check messages when no remote repository is specified:
2272 "no remote repo" route for "hg outgoing --large" is not tested here,
2273 because it can't be reproduced easily.
2274
2275 $ hg init clone1
2276 $ hg -R clone1 -q pull src
2277 $ hg -R clone1 -q update
2278 $ hg -R clone1 paths | grep default
2279 [1]
2280
2281 $ hg -R clone1 summary --large
2282 parent: 0:fc0bd45326d3 tip
2283 #0
2284 branch: default
2285 commit: (clean)
2286 update: (current)
2287 largefiles: (no remote repo)
2288
2289 check messages when there is no files to upload:
2290
2291 $ hg -q clone src clone2
2292 $ hg -R clone2 paths | grep default
2293 default = $TESTTMP/issue3651/src (glob)
2294
2295 $ hg -R clone2 summary --large
2296 parent: 0:fc0bd45326d3 tip
2297 #0
2298 branch: default
2299 commit: (clean)
2300 update: (current)
2301 largefiles: (no files to upload)
2302 $ hg -R clone2 outgoing --large
2303 comparing with $TESTTMP/issue3651/src (glob)
2304 searching for changes
2305 no changes found
2306 largefiles: no files to upload
2307 [1]
2308
2309 $ hg -R clone2 outgoing --large --graph --template "{rev}"
2310 comparing with $TESTTMP/issue3651/src (glob)
2311 searching for changes
2312 no changes found
2313 largefiles: no files to upload
2314
2315 check messages when there are files to upload:
2316
2317 $ echo b > clone2/b
2318 $ hg -R clone2 add --large clone2/b
2319 $ hg -R clone2 commit -m '#1'
2320 Invoking status precommit hook
2321 A b
2322 $ hg -R clone2 summary --large
2323 parent: 1:1acbe71ce432 tip
2324 #1
2325 branch: default
2326 commit: (clean)
2327 update: (current)
2328 largefiles: 1 to upload
2329 $ hg -R clone2 outgoing --large
2330 comparing with $TESTTMP/issue3651/src (glob)
2331 searching for changes
2332 changeset: 1:1acbe71ce432
2333 tag: tip
2334 user: test
2335 date: Thu Jan 01 00:00:00 1970 +0000
2336 summary: #1
2337
2338 largefiles to upload:
2339 b
2340
2341 $ hg -R clone2 outgoing --large --graph --template "{rev}"
2342 comparing with $TESTTMP/issue3651/src
2343 searching for changes
2344 @ 1
2345
2346 largefiles to upload:
2347 b
2348
2349
2350 $ cd ..
2351
2352 merge action 'd' for 'local renamed directory to d2/g' which has no filename
2353
2354 $ hg init merge-action
2355 $ cd merge-action
2356 $ touch l
2357 $ hg add --large l
2358 $ mkdir d1
2359 $ touch d1/f
2360 $ hg ci -Aqm0
2361 Invoking status precommit hook
2362 A d1/f
2363 A l
2364 $ echo > d1/f
2365 $ touch d1/g
2366 $ hg ci -Aqm1
2367 Invoking status precommit hook
2368 M d1/f
2369 A d1/g
2370 $ hg up -qr0
2371 $ hg mv d1 d2
2372 moving d1/f to d2/f (glob)
2373 $ hg ci -qm2
2374 Invoking status precommit hook
2375 A d2/f
2376 R d1/f
2377 $ hg merge
2378 merging d2/f and d1/f to d2/f
2379 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
2380 (branch merge, don't forget to commit)
2381 getting changed largefiles
2382 0 largefiles updated, 0 removed
2383 $ cd ..
2384
2385
2386 Merge conflicts:
2387
2388 $ hg init merge
2389 $ cd merge
2390 $ echo 0 > f-different
2391 $ echo 0 > f-same
2392 $ echo 0 > f-unchanged-1
2393 $ echo 0 > f-unchanged-2
2394 $ hg add --large *
2395 $ hg ci -m0
2396 Invoking status precommit hook
2397 A f-different
2398 A f-same
2399 A f-unchanged-1
2400 A f-unchanged-2
2401 $ echo tmp1 > f-unchanged-1
2402 $ echo tmp1 > f-unchanged-2
2403 $ echo tmp1 > f-same
2404 $ hg ci -m1
2405 Invoking status precommit hook
2406 M f-same
2407 M f-unchanged-1
2408 M f-unchanged-2
2409 $ echo 2 > f-different
2410 $ echo 0 > f-unchanged-1
2411 $ echo 1 > f-unchanged-2
2412 $ echo 1 > f-same
2413 $ hg ci -m2
2414 Invoking status precommit hook
2415 M f-different
2416 M f-same
2417 M f-unchanged-1
2418 M f-unchanged-2
2419 $ hg up -qr0
2420 $ echo tmp2 > f-unchanged-1
2421 $ echo tmp2 > f-unchanged-2
2422 $ echo tmp2 > f-same
2423 $ hg ci -m3
2424 Invoking status precommit hook
2425 M f-same
2426 M f-unchanged-1
2427 M f-unchanged-2
2428 created new head
2429 $ echo 1 > f-different
2430 $ echo 1 > f-unchanged-1
2431 $ echo 0 > f-unchanged-2
2432 $ echo 1 > f-same
2433 $ hg ci -m4
2434 Invoking status precommit hook
2435 M f-different
2436 M f-same
2437 M f-unchanged-1
2438 M f-unchanged-2
2439 $ hg merge
2440 largefile f-different has a merge conflict
2441 ancestor was 09d2af8dd22201dd8d48e5dcfcaed281ff9422c7
2442 keep (l)ocal e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e or
2443 take (o)ther 7448d8798a4380162d4b56f9b452e2f6f9e24e7a? l
2444 0 files updated, 4 files merged, 0 files removed, 0 files unresolved
2445 (branch merge, don't forget to commit)
2446 getting changed largefiles
2447 1 largefiles updated, 0 removed
2448 $ cat f-different
2449 1
2450 $ cat f-same
2451 1
2452 $ cat f-unchanged-1
2453 1
2454 $ cat f-unchanged-2
2455 1
2456 $ cd ..
2457
2458 Check whether "largefiles" feature is supported only in repositories
2459 enabling largefiles extension.
2460
2461 $ mkdir individualenabling
2462 $ cd individualenabling
2463
2464 $ hg init enabledlocally
2465 $ echo large > enabledlocally/large
2466 $ hg -R enabledlocally add --large enabledlocally/large
2467 $ hg -R enabledlocally commit -m '#0'
2468 Invoking status precommit hook
2469 A large
2470
2471 $ hg init notenabledlocally
2472 $ echo large > notenabledlocally/large
2473 $ hg -R notenabledlocally add --large notenabledlocally/large
2474 $ hg -R notenabledlocally commit -m '#0'
2475 Invoking status precommit hook
2476 A large
2477
2478 $ cat >> $HGRCPATH <<EOF
2479 > [extensions]
2480 > # disable globally
2481 > largefiles=!
2482 > EOF
2483 $ cat >> enabledlocally/.hg/hgrc <<EOF
2484 > [extensions]
2485 > # enable locally
2486 > largefiles=
2487 > EOF
2488 $ hg -R enabledlocally root
2489 $TESTTMP/individualenabling/enabledlocally (glob)
2490 $ hg -R notenabledlocally root
2491 abort: repository requires features unknown to this Mercurial: largefiles!
2492 (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
2493 [255]
2494
2495 $ hg init push-dst
2496 $ hg -R enabledlocally push push-dst
2497 pushing to push-dst
2498 abort: required features are not supported in the destination: largefiles
2499 [255]
2500
2501 $ hg init pull-src
2502 $ hg -R pull-src pull enabledlocally
2503 pulling from enabledlocally
2504 abort: required features are not supported in the destination: largefiles
2505 [255]
2506
2507 $ hg clone enabledlocally clone-dst
2508 abort: repository requires features unknown to this Mercurial: largefiles!
2509 (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
2510 [255]
2511 $ test -d clone-dst
2512 [1]
2513 $ hg clone --pull enabledlocally clone-pull-dst
2514 abort: required features are not supported in the destination: largefiles
2515 [255]
2516 $ test -d clone-pull-dst
2517 [1]
2518
2519 #if serve
2520
2521 Test largefiles specific peer setup, when largefiles is enabled
2522 locally (issue4109)
2523
2524 $ hg showconfig extensions | grep largefiles
2525 extensions.largefiles=!
2526 $ mkdir -p $TESTTMP/individualenabling/usercache
2527
2528 $ hg serve -R enabledlocally -d -p $HGPORT --pid-file hg.pid
2529 $ cat hg.pid >> $DAEMON_PIDS
2530
2531 $ hg init pull-dst
2532 $ cat > pull-dst/.hg/hgrc <<EOF
2533 > [extensions]
2534 > # enable locally
2535 > largefiles=
2536 > [largefiles]
2537 > # ignore system cache to force largefiles specific wire proto access
2538 > usercache=$TESTTMP/individualenabling/usercache
2539 > EOF
2540 $ hg -R pull-dst -q pull -u http://localhost:$HGPORT
2541
2542 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
2543 #endif
2544
2545 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now