Show More
@@ -1,233 +1,260 b'' | |||
|
1 | 1 | $ cat >> $HGRCPATH <<EOF |
|
2 | 2 | > [extensions] |
|
3 | 3 | > largefiles = |
|
4 | 4 | > share = |
|
5 | 5 | > graphlog = |
|
6 | > mq = | |
|
6 | 7 | > [largefiles] |
|
7 | 8 | > minsize = 0.5 |
|
8 | 9 | > patterns = **.other |
|
9 | 10 | > **.dat |
|
10 | 11 | > EOF |
|
11 | 12 | |
|
12 | 13 | "lfconvert" works |
|
13 | 14 | $ hg init bigfile-repo |
|
14 | 15 | $ cd bigfile-repo |
|
15 | 16 | $ cat >> .hg/hgrc <<EOF |
|
16 | 17 | > [extensions] |
|
17 | 18 | > largefiles = ! |
|
18 | 19 | > EOF |
|
19 | 20 | $ mkdir sub |
|
20 | 21 | $ dd if=/dev/zero bs=1k count=256 > large 2> /dev/null |
|
22 | $ dd if=/dev/zero bs=1k count=256 > large2 2> /dev/null | |
|
21 | 23 | $ echo normal > normal1 |
|
22 | 24 | $ echo alsonormal > sub/normal2 |
|
23 | 25 | $ dd if=/dev/zero bs=1k count=10 > sub/maybelarge.dat 2> /dev/null |
|
24 | 26 | $ hg addremove |
|
25 | 27 | adding large |
|
28 | adding large2 | |
|
26 | 29 | adding normal1 |
|
27 | 30 | adding sub/maybelarge.dat |
|
28 | 31 | adding sub/normal2 |
|
29 | 32 | $ hg commit -m"add large, normal1" large normal1 |
|
30 | 33 | $ hg commit -m"add sub/*" sub |
|
34 | Test tag parsing | |
|
35 | $ cat >> .hgtags <<EOF | |
|
36 | > IncorrectlyFormattedTag! | |
|
37 | > invalidhash sometag | |
|
38 | > 0123456789abcdef anothertag | |
|
39 | > EOF | |
|
40 | $ hg add .hgtags | |
|
41 | $ hg commit -m"add large2" large2 .hgtags | |
|
42 | $ hg rename large2 large3 | |
|
43 | Test link+rename largefile codepath | |
|
44 | $ ln -sf large large3 | |
|
45 | $ hg commit -m"make large2 a symlink" large2 large3 | |
|
31 | 46 | $ [ -d .hg/largefiles ] && echo fail || echo pass |
|
32 | 47 | pass |
|
33 | 48 | $ cd .. |
|
34 | 49 | $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo |
|
35 | 50 | initializing destination largefiles-repo |
|
51 | skipping incorrectly formatted tag IncorrectlyFormattedTag! | |
|
52 | skipping incorrectly formatted id invalidhash | |
|
53 | no mapping for id 0123456789abcdef | |
|
54 | abort: renamed/copied largefile large3 becomes symlink | |
|
55 | [255] | |
|
56 | $ cd bigfile-repo | |
|
57 | $ hg strip --no-backup 2 | |
|
58 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
|
59 | $ cd .. | |
|
60 | $ rm -rf largefiles-repo | |
|
61 | $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo | |
|
62 | initializing destination largefiles-repo | |
|
36 | 63 | |
|
37 | 64 | "lfconvert" converts content correctly |
|
38 | 65 | $ cd largefiles-repo |
|
39 | 66 | $ hg up |
|
40 | 67 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
41 | 68 | getting changed largefiles |
|
42 | 69 | 2 largefiles updated, 0 removed |
|
43 | 70 | $ hg locate |
|
44 | 71 | .hglf/large |
|
45 | 72 | .hglf/sub/maybelarge.dat |
|
46 | 73 | normal1 |
|
47 | 74 | sub/normal2 |
|
48 | 75 | $ cat normal1 |
|
49 | 76 | normal |
|
50 | 77 | $ cat sub/normal2 |
|
51 | 78 | alsonormal |
|
52 | 79 | $ "$TESTDIR/md5sum.py" large sub/maybelarge.dat |
|
53 | 80 | ec87a838931d4d5d2e94a04644788a55 large |
|
54 | 81 | 1276481102f218c981e0324180bafd9f sub/maybelarge.dat |
|
55 | 82 | |
|
56 | 83 | "lfconvert" adds 'largefiles' to .hg/requires. |
|
57 | 84 | $ cat .hg/requires |
|
58 | 85 | largefiles |
|
59 | 86 | revlogv1 |
|
60 | 87 | fncache |
|
61 | 88 | store |
|
62 | 89 | dotencode |
|
63 | 90 | |
|
64 | 91 | "lfconvert" includes a newline at the end of the standin files. |
|
65 | 92 | $ cat .hglf/large .hglf/sub/maybelarge.dat |
|
66 | 93 | 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 |
|
67 | 94 | 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c |
|
68 | 95 | $ cd .. |
|
69 | 96 | |
|
70 | 97 | add some changesets to rename/remove/merge |
|
71 | 98 | $ cd bigfile-repo |
|
72 | 99 | $ hg mv -q sub stuff |
|
73 | 100 | $ hg commit -m"rename sub/ to stuff/" |
|
74 | 101 | $ hg update -q 1 |
|
75 | 102 | $ echo blah >> normal3 |
|
76 | 103 | $ echo blah >> sub/normal2 |
|
77 | 104 | $ echo blah >> sub/maybelarge.dat |
|
78 | 105 | $ "$TESTDIR/md5sum.py" sub/maybelarge.dat |
|
79 | 106 | 1dd0b99ff80e19cff409702a1d3f5e15 sub/maybelarge.dat |
|
80 | 107 | $ hg commit -A -m"add normal3, modify sub/*" |
|
81 | 108 | adding normal3 |
|
82 | 109 | created new head |
|
83 | 110 | $ hg rm large normal3 |
|
84 | 111 | $ hg commit -q -m"remove large, normal3" |
|
85 | 112 | $ hg merge |
|
86 | 113 | merging sub/maybelarge.dat and stuff/maybelarge.dat to stuff/maybelarge.dat |
|
87 | 114 | warning: $TESTTMP/bigfile-repo/stuff/maybelarge.dat looks like a binary file. (glob) |
|
88 | 115 | merging stuff/maybelarge.dat incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
89 | 116 | merging sub/normal2 and stuff/normal2 to stuff/normal2 |
|
90 | 117 | 0 files updated, 1 files merged, 0 files removed, 1 files unresolved |
|
91 | 118 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
92 | 119 | [1] |
|
93 | 120 | $ hg cat -r . sub/maybelarge.dat > stuff/maybelarge.dat |
|
94 | 121 | $ hg resolve -m stuff/maybelarge.dat |
|
95 | 122 | $ hg commit -m"merge" |
|
96 | 123 | $ hg glog --template "{rev}:{node|short} {desc|firstline}\n" |
|
97 | 124 | @ 5:4884f215abda merge |
|
98 | 125 | |\ |
|
99 | 126 | | o 4:7285f817b77e remove large, normal3 |
|
100 | 127 | | | |
|
101 | 128 | | o 3:67e3892e3534 add normal3, modify sub/* |
|
102 | 129 | | | |
|
103 | 130 | o | 2:c96c8beb5d56 rename sub/ to stuff/ |
|
104 | 131 | |/ |
|
105 | 132 | o 1:020c65d24e11 add sub/* |
|
106 | 133 | | |
|
107 | 134 | o 0:117b8328f97a add large, normal1 |
|
108 | 135 | |
|
109 | 136 | $ cd .. |
|
110 | 137 | |
|
111 | 138 | lfconvert with rename, merge, and remove |
|
112 | 139 | $ rm -rf largefiles-repo |
|
113 | 140 | $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo |
|
114 | 141 | initializing destination largefiles-repo |
|
115 | 142 | $ cd largefiles-repo |
|
116 | 143 | $ hg glog --template "{rev}:{node|short} {desc|firstline}\n" |
|
117 | 144 | o 5:8e05f5f2b77e merge |
|
118 | 145 | |\ |
|
119 | 146 | | o 4:a5a02de7a8e4 remove large, normal3 |
|
120 | 147 | | | |
|
121 | 148 | | o 3:55759520c76f add normal3, modify sub/* |
|
122 | 149 | | | |
|
123 | 150 | o | 2:261ad3f3f037 rename sub/ to stuff/ |
|
124 | 151 | |/ |
|
125 | 152 | o 1:334e5237836d add sub/* |
|
126 | 153 | | |
|
127 | 154 | o 0:d4892ec57ce2 add large, normal1 |
|
128 | 155 | |
|
129 | 156 | $ hg locate -r 2 |
|
130 | 157 | .hglf/large |
|
131 | 158 | .hglf/stuff/maybelarge.dat |
|
132 | 159 | normal1 |
|
133 | 160 | stuff/normal2 |
|
134 | 161 | $ hg locate -r 3 |
|
135 | 162 | .hglf/large |
|
136 | 163 | .hglf/sub/maybelarge.dat |
|
137 | 164 | normal1 |
|
138 | 165 | normal3 |
|
139 | 166 | sub/normal2 |
|
140 | 167 | $ hg locate -r 4 |
|
141 | 168 | .hglf/sub/maybelarge.dat |
|
142 | 169 | normal1 |
|
143 | 170 | sub/normal2 |
|
144 | 171 | $ hg locate -r 5 |
|
145 | 172 | .hglf/stuff/maybelarge.dat |
|
146 | 173 | normal1 |
|
147 | 174 | stuff/normal2 |
|
148 | 175 | $ hg update |
|
149 | 176 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
150 | 177 | getting changed largefiles |
|
151 | 178 | 1 largefiles updated, 0 removed |
|
152 | 179 | $ cat stuff/normal2 |
|
153 | 180 | alsonormal |
|
154 | 181 | blah |
|
155 | 182 | $ "$TESTDIR/md5sum.py" stuff/maybelarge.dat |
|
156 | 183 | 1dd0b99ff80e19cff409702a1d3f5e15 stuff/maybelarge.dat |
|
157 | 184 | $ cat .hglf/stuff/maybelarge.dat |
|
158 | 185 | 76236b6a2c6102826c61af4297dd738fb3b1de38 |
|
159 | 186 | $ cd .. |
|
160 | 187 | |
|
161 | 188 | "lfconvert" error cases |
|
162 | 189 | $ hg lfconvert http://localhost/foo foo |
|
163 | 190 | abort: http://localhost/foo is not a local Mercurial repo |
|
164 | 191 | [255] |
|
165 | 192 | $ hg lfconvert foo ssh://localhost/foo |
|
166 | 193 | abort: ssh://localhost/foo is not a local Mercurial repo |
|
167 | 194 | [255] |
|
168 | 195 | $ hg lfconvert nosuchrepo foo |
|
169 | 196 | abort: repository nosuchrepo not found! |
|
170 | 197 | [255] |
|
171 | 198 | $ hg share -q -U bigfile-repo shared |
|
172 | 199 | $ printf 'bogus' > shared/.hg/sharedpath |
|
173 | 200 | $ hg lfconvert shared foo |
|
174 | 201 | abort: .hg/sharedpath points to nonexistent directory $TESTTMP/bogus! (glob) |
|
175 | 202 | [255] |
|
176 | 203 | $ hg lfconvert bigfile-repo largefiles-repo |
|
177 | 204 | initializing destination largefiles-repo |
|
178 | 205 | abort: repository largefiles-repo already exists! |
|
179 | 206 | [255] |
|
180 | 207 | |
|
181 | 208 | add another largefile to the new largefiles repo |
|
182 | 209 | $ cd largefiles-repo |
|
183 | 210 | $ dd if=/dev/zero bs=1k count=1k > anotherlarge 2> /dev/null |
|
184 | 211 | $ hg add --lfsize=1 anotherlarge |
|
185 | 212 | $ hg commit -m "add anotherlarge (should be a largefile)" |
|
186 | 213 | $ cat .hglf/anotherlarge |
|
187 | 214 | 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3 |
|
188 | 215 | $ cd .. |
|
189 | 216 | |
|
190 | 217 | round-trip: converting back to a normal (non-largefiles) repo with |
|
191 | 218 | "lfconvert --to-normal" should give the same as ../bigfile-repo |
|
192 | 219 | $ cd largefiles-repo |
|
193 | 220 | $ hg lfconvert --to-normal . ../normal-repo |
|
194 | 221 | initializing destination ../normal-repo |
|
195 | 222 | $ cd ../normal-repo |
|
196 | 223 | $ cat >> .hg/hgrc <<EOF |
|
197 | 224 | > [extensions] |
|
198 | 225 | > largefiles = ! |
|
199 | 226 | > EOF |
|
200 | 227 | |
|
201 | 228 | # Hmmm: the changeset ID for rev 5 is different from the original |
|
202 | 229 | # normal repo (../bigfile-repo), because the changelog filelist |
|
203 | 230 | # differs between the two incarnations of rev 5: this repo includes |
|
204 | 231 | # 'large' in the list, but ../bigfile-repo does not. Since rev 5 |
|
205 | 232 | # removes 'large' relative to the first parent in both repos, it seems |
|
206 | 233 | # to me that lfconvert is doing a *better* job than |
|
207 | 234 | # "hg remove" + "hg merge" + "hg commit". |
|
208 | 235 | # $ hg -R ../bigfile-repo debugdata -c 5 |
|
209 | 236 | # $ hg debugdata -c 5 |
|
210 | 237 | $ hg glog --template "{rev}:{node|short} {desc|firstline}\n" |
|
211 | 238 | o 6:1635824e6f59 add anotherlarge (should be a largefile) |
|
212 | 239 | | |
|
213 | 240 | o 5:7215f8deeaaf merge |
|
214 | 241 | |\ |
|
215 | 242 | | o 4:7285f817b77e remove large, normal3 |
|
216 | 243 | | | |
|
217 | 244 | | o 3:67e3892e3534 add normal3, modify sub/* |
|
218 | 245 | | | |
|
219 | 246 | o | 2:c96c8beb5d56 rename sub/ to stuff/ |
|
220 | 247 | |/ |
|
221 | 248 | o 1:020c65d24e11 add sub/* |
|
222 | 249 | | |
|
223 | 250 | o 0:117b8328f97a add large, normal1 |
|
224 | 251 | |
|
225 | 252 | $ hg update |
|
226 | 253 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
227 | 254 | $ hg locate |
|
228 | 255 | anotherlarge |
|
229 | 256 | normal1 |
|
230 | 257 | stuff/maybelarge.dat |
|
231 | 258 | stuff/normal2 |
|
232 | 259 | $ [ -d .hg/largefiles ] && echo fail || echo pass |
|
233 | 260 | pass |
General Comments 0
You need to be logged in to leave comments.
Login now