Show More
@@ -1,86 +1,114 b'' | |||
|
1 | 1 | $ cat >> $HGRCPATH <<EOF |
|
2 | 2 | > [extensions] |
|
3 | 3 | > largefiles = |
|
4 | 4 | > share = |
|
5 | 5 | > [largefiles] |
|
6 | 6 | > minsize = 0.5 |
|
7 | 7 | > patterns = **.dat |
|
8 | 8 | > EOF |
|
9 | 9 | |
|
10 | 10 | "lfconvert" works |
|
11 | 11 | $ hg init bigfile-repo |
|
12 | 12 | $ cd bigfile-repo |
|
13 | $ dd if=/dev/zero bs=1k count=256 > a-large-file 2> /dev/null | |
|
13 | $ cat >> .hg/hgrc <<EOF | |
|
14 | > [extensions] | |
|
15 | > largefiles = ! | |
|
16 | > EOF | |
|
17 | $ mkdir sub | |
|
18 | $ dd if=/dev/zero bs=1k count=256 > large 2> /dev/null | |
|
19 | $ echo normal > normal1 | |
|
20 | $ echo alsonormal > sub/normal2 | |
|
21 | $ dd if=/dev/zero bs=1k count=10 > sub/maybelarge.dat 2> /dev/null | |
|
14 | 22 | $ hg addremove |
|
15 |
adding |
|
|
16 | $ hg commit -m "add a-large-file (as a normal file)" | |
|
17 | $ find .hg/largefiles | |
|
18 | .hg/largefiles | |
|
23 | adding large | |
|
24 | adding normal1 | |
|
25 | adding sub/maybelarge.dat | |
|
26 | adding sub/normal2 | |
|
27 | $ hg commit -m"add large, normal1" large normal1 | |
|
28 | $ hg commit -m"add sub/*" sub | |
|
29 | $ [ -d .hg/largefiles ] && echo fail || echo pass | |
|
30 | pass | |
|
19 | 31 |
$ |
|
20 | 32 |
$ |
|
21 | 33 | initializing destination largefiles-repo |
|
22 | 34 | |
|
35 | "lfconvert" converts content correctly | |
|
36 | $ cd largefiles-repo | |
|
37 | $ hg up | |
|
38 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
39 | getting changed largefiles | |
|
40 | 2 largefiles updated, 0 removed | |
|
41 | $ hg locate | |
|
42 | .hglf/large | |
|
43 | .hglf/sub/maybelarge.dat | |
|
44 | normal1 | |
|
45 | sub/normal2 | |
|
46 | $ cat normal1 | |
|
47 | normal | |
|
48 | $ cat sub/normal2 | |
|
49 | alsonormal | |
|
50 | $ sha1sum large sub/maybelarge.dat | |
|
51 | 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 large | |
|
52 | 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c sub/maybelarge.dat | |
|
53 | ||
|
23 | 54 | "lfconvert" adds 'largefiles' to .hg/requires. |
|
24 |
$ cat |
|
|
55 | $ cat .hg/requires | |
|
25 | 56 | largefiles |
|
26 | 57 | revlogv1 |
|
27 | 58 | fncache |
|
28 | 59 | store |
|
29 | 60 | dotencode |
|
30 | 61 | |
|
31 | 62 | "lfconvert" includes a newline at the end of the standin files. |
|
32 | $ cd largefiles-repo | |
|
33 | $ hg up | |
|
34 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
35 | getting changed largefiles | |
|
36 | 1 largefiles updated, 0 removed | |
|
37 | $ cat .hglf/a-large-file | |
|
63 | $ cat .hglf/large .hglf/sub/maybelarge.dat | |
|
38 | 64 | 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 |
|
39 | $ dd if=/dev/zero bs=1k count=1k > another-large-file 2> /dev/null | |
|
40 | $ hg add --lfsize=1 another-large-file | |
|
41 | $ hg commit -m "add another-large-file (should be a largefile)" | |
|
42 | $ cat .hglf/a-large-file .hglf/another-large-file | |
|
65 | 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c | |
|
66 | ||
|
67 | add another largefile to the new largefiles repo | |
|
68 | $ dd if=/dev/zero bs=1k count=1k > anotherlarge 2> /dev/null | |
|
69 | $ hg add --lfsize=1 anotherlarge | |
|
70 | $ hg commit -m "add anotherlarge (should be a largefile)" | |
|
71 | $ cat .hglf/large .hglf/anotherlarge | |
|
43 | 72 | 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 |
|
44 | 73 | 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3 |
|
45 | 74 | $ cd .. |
|
46 | 75 | |
|
47 | 76 | "lfconvert" error cases |
|
48 | 77 | $ hg lfconvert http://localhost/foo foo |
|
49 | 78 | abort: http://localhost/foo is not a local Mercurial repo |
|
50 | 79 | [255] |
|
51 | 80 | $ hg lfconvert foo ssh://localhost/foo |
|
52 | 81 | abort: ssh://localhost/foo is not a local Mercurial repo |
|
53 | 82 | [255] |
|
54 | 83 | $ hg lfconvert nosuchrepo foo |
|
55 | 84 | abort: repository nosuchrepo not found! |
|
56 | 85 | [255] |
|
57 | 86 | $ hg share -q -U bigfile-repo shared |
|
58 | 87 | $ echo -n bogus > shared/.hg/sharedpath |
|
59 | 88 | $ hg lfconvert shared foo |
|
60 | 89 | abort: .hg/sharedpath points to nonexistent directory $TESTTMP/bogus! |
|
61 | 90 | [255] |
|
62 | 91 | $ hg lfconvert bigfile-repo largefiles-repo |
|
63 | 92 | initializing destination largefiles-repo |
|
64 | 93 | abort: repository largefiles-repo already exists! |
|
65 | 94 | [255] |
|
66 | 95 | |
|
67 | 96 | Convert back to a normal (non-largefiles) repo |
|
68 | 97 | $ cd largefiles-repo |
|
69 | 98 | $ hg lfconvert --to-normal . ../normal-repo |
|
70 | 99 | initializing destination ../normal-repo |
|
71 | 100 | $ cd ../normal-repo |
|
72 | 101 | $ cat >> .hg/hgrc <<EOF |
|
73 | 102 | > [extensions] |
|
74 | 103 | > largefiles = ! |
|
75 | 104 | > EOF |
|
76 | 105 | $ hg update |
|
77 |
|
|
|
106 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
78 | 107 | $ hg locate |
|
79 | a-large-file | |
|
80 | another-large-file | |
|
108 | anotherlarge | |
|
109 | large | |
|
110 | normal1 | |
|
111 | sub/maybelarge.dat | |
|
112 | sub/normal2 | |
|
81 | 113 | $ [ -d .hg/largefiles ] && echo fail || echo pass |
|
82 | 114 | pass |
|
83 | ||
|
84 | Cleanup | |
|
85 | $ cd .. | |
|
86 | $ rm -rf bigfile-repo largefiles-repo normal-repo |
General Comments 0
You need to be logged in to leave comments.
Login now