##// END OF EJS Templates
test: enable sparse-revlog for test-lfconvert.t...
Boris Feld -
r40931:ed8e4748 default
parent child Browse files
Show More
@@ -1,397 +1,404 b''
1 TRANSITIONAL CONFIG
2 $ cat << EOF >> $HGRCPATH
3 > [format]
4 > sparse-revlog = yes
5 > EOF
6
1 7 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
2 8 $ mkdir "${USERCACHE}"
3 9 $ cat >> $HGRCPATH <<EOF
4 10 > [extensions]
5 11 > largefiles =
6 12 > share =
7 13 > strip =
8 14 > convert =
9 15 > [largefiles]
10 16 > minsize = 0.5
11 17 > patterns = **.other
12 18 > **.dat
13 19 > usercache=${USERCACHE}
14 20 > EOF
15 21
16 22 "lfconvert" works
17 23 $ hg init bigfile-repo
18 24 $ cd bigfile-repo
19 25 $ cat >> .hg/hgrc <<EOF
20 26 > [extensions]
21 27 > largefiles = !
22 28 > EOF
23 29 $ mkdir sub
24 30 $ dd if=/dev/zero bs=1k count=256 > large 2> /dev/null
25 31 $ dd if=/dev/zero bs=1k count=256 > large2 2> /dev/null
26 32 $ echo normal > normal1
27 33 $ echo alsonormal > sub/normal2
28 34 $ dd if=/dev/zero bs=1k count=10 > sub/maybelarge.dat 2> /dev/null
29 35 $ hg addremove
30 36 adding large
31 37 adding large2
32 38 adding normal1
33 39 adding sub/maybelarge.dat
34 40 adding sub/normal2
35 41 $ hg commit -m"add large, normal1" large normal1
36 42 $ hg commit -m"add sub/*" sub
37 43
38 44 Test tag parsing
39 45 $ cat >> .hgtags <<EOF
40 46 > IncorrectlyFormattedTag!
41 47 > invalidhash sometag
42 48 > 0123456789abcdef anothertag
43 49 > EOF
44 50 $ hg add .hgtags
45 51 $ hg commit -m"add large2" large2 .hgtags
46 52
47 53 Test link+rename largefile codepath
48 54 $ [ -d .hg/largefiles ] && echo fail || echo pass
49 55 pass
50 56 $ cd ..
51 57 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
52 58 initializing destination largefiles-repo
53 59 skipping incorrectly formatted tag IncorrectlyFormattedTag!
54 60 skipping incorrectly formatted id invalidhash
55 61 no mapping for id 0123456789abcdef
56 62 #if symlink
57 63 $ hg --cwd bigfile-repo rename large2 large3
58 64 $ ln -sf large bigfile-repo/large3
59 65 $ hg --cwd bigfile-repo commit -m"make large2 a symlink" large2 large3
60 66 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo-symlink
61 67 initializing destination largefiles-repo-symlink
62 68 skipping incorrectly formatted tag IncorrectlyFormattedTag!
63 69 skipping incorrectly formatted id invalidhash
64 70 no mapping for id 0123456789abcdef
65 71 abort: renamed/copied largefile large3 becomes symlink
66 72 [255]
67 73 #endif
68 74 $ cd bigfile-repo
69 75 $ hg strip --no-backup 2
70 76 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
71 77 $ cd ..
72 78 $ rm -rf largefiles-repo largefiles-repo-symlink
73 79
74 80 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
75 81 initializing destination largefiles-repo
76 82
77 83 "lfconvert" converts content correctly
78 84 $ cd largefiles-repo
79 85 $ hg up
80 86 getting changed largefiles
81 87 2 largefiles updated, 0 removed
82 88 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
83 89 $ hg locate
84 90 .hglf/large
85 91 .hglf/sub/maybelarge.dat
86 92 normal1
87 93 sub/normal2
88 94 $ cat normal1
89 95 normal
90 96 $ cat sub/normal2
91 97 alsonormal
92 98 $ md5sum.py large sub/maybelarge.dat
93 99 ec87a838931d4d5d2e94a04644788a55 large
94 100 1276481102f218c981e0324180bafd9f sub/maybelarge.dat
95 101
96 102 "lfconvert" adds 'largefiles' to .hg/requires.
97 103 $ cat .hg/requires
98 104 dotencode
99 105 fncache
100 106 generaldelta
101 107 largefiles
102 108 revlogv1
109 sparserevlog
103 110 store
104 111 testonly-simplestore (reposimplestore !)
105 112
106 113 "lfconvert" includes a newline at the end of the standin files.
107 114 $ cat .hglf/large .hglf/sub/maybelarge.dat
108 115 2e000fa7e85759c7f4c254d4d9c33ef481e459a7
109 116 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c
110 117 $ cd ..
111 118
112 119 add some changesets to rename/remove/merge
113 120 $ cd bigfile-repo
114 121 $ hg mv -q sub stuff
115 122 $ hg commit -m"rename sub/ to stuff/"
116 123 $ hg update -q 1
117 124 $ echo blah >> normal3
118 125 $ echo blah >> sub/normal2
119 126 $ echo blah >> sub/maybelarge.dat
120 127 $ md5sum.py sub/maybelarge.dat
121 128 1dd0b99ff80e19cff409702a1d3f5e15 sub/maybelarge.dat
122 129 $ hg commit -A -m"add normal3, modify sub/*"
123 130 adding normal3
124 131 created new head
125 132 $ hg rm large normal3
126 133 $ hg commit -q -m"remove large, normal3"
127 134 $ hg merge
128 135 tool internal:merge (for pattern stuff/maybelarge.dat) can't handle binary
129 136 no tool found to merge stuff/maybelarge.dat
130 137 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for stuff/maybelarge.dat? u
131 138 merging sub/normal2 and stuff/normal2 to stuff/normal2
132 139 0 files updated, 1 files merged, 0 files removed, 1 files unresolved
133 140 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
134 141 [1]
135 142 $ hg cat -r . sub/maybelarge.dat > stuff/maybelarge.dat
136 143 $ hg resolve -m stuff/maybelarge.dat
137 144 (no more unresolved files)
138 145 $ hg commit -m"merge"
139 146 $ hg log -G --template "{rev}:{node|short} {desc|firstline}\n"
140 147 @ 5:4884f215abda merge
141 148 |\
142 149 | o 4:7285f817b77e remove large, normal3
143 150 | |
144 151 | o 3:67e3892e3534 add normal3, modify sub/*
145 152 | |
146 153 o | 2:c96c8beb5d56 rename sub/ to stuff/
147 154 |/
148 155 o 1:020c65d24e11 add sub/*
149 156 |
150 157 o 0:117b8328f97a add large, normal1
151 158
152 159 $ cd ..
153 160
154 161 lfconvert with rename, merge, and remove
155 162 $ rm -rf largefiles-repo
156 163 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
157 164 initializing destination largefiles-repo
158 165 $ cd largefiles-repo
159 166 $ hg log -G --template "{rev}:{node|short} {desc|firstline}\n"
160 167 o 5:8e05f5f2b77e merge
161 168 |\
162 169 | o 4:a5a02de7a8e4 remove large, normal3
163 170 | |
164 171 | o 3:55759520c76f add normal3, modify sub/*
165 172 | |
166 173 o | 2:261ad3f3f037 rename sub/ to stuff/
167 174 |/
168 175 o 1:334e5237836d add sub/*
169 176 |
170 177 o 0:d4892ec57ce2 add large, normal1
171 178
172 179 $ hg locate -r 2
173 180 .hglf/large
174 181 .hglf/stuff/maybelarge.dat
175 182 normal1
176 183 stuff/normal2
177 184 $ hg locate -r 3
178 185 .hglf/large
179 186 .hglf/sub/maybelarge.dat
180 187 normal1
181 188 normal3
182 189 sub/normal2
183 190 $ hg locate -r 4
184 191 .hglf/sub/maybelarge.dat
185 192 normal1
186 193 sub/normal2
187 194 $ hg locate -r 5
188 195 .hglf/stuff/maybelarge.dat
189 196 normal1
190 197 stuff/normal2
191 198 $ hg update
192 199 getting changed largefiles
193 200 1 largefiles updated, 0 removed
194 201 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
195 202 $ cat stuff/normal2
196 203 alsonormal
197 204 blah
198 205 $ md5sum.py stuff/maybelarge.dat
199 206 1dd0b99ff80e19cff409702a1d3f5e15 stuff/maybelarge.dat
200 207 $ cat .hglf/stuff/maybelarge.dat
201 208 76236b6a2c6102826c61af4297dd738fb3b1de38
202 209 $ cd ..
203 210
204 211 "lfconvert" error cases
205 212 $ hg lfconvert http://localhost/foo foo
206 213 abort: http://localhost/foo is not a local Mercurial repo
207 214 [255]
208 215 $ hg lfconvert foo ssh://localhost/foo
209 216 abort: ssh://localhost/foo is not a local Mercurial repo
210 217 [255]
211 218 $ hg lfconvert nosuchrepo foo
212 219 abort: repository nosuchrepo not found!
213 220 [255]
214 221 $ hg share -q -U bigfile-repo shared
215 222 $ printf 'bogus' > shared/.hg/sharedpath
216 223 $ hg lfconvert shared foo
217 224 abort: .hg/sharedpath points to nonexistent directory $TESTTMP/bogus!
218 225 [255]
219 226 $ hg lfconvert bigfile-repo largefiles-repo
220 227 initializing destination largefiles-repo
221 228 abort: repository largefiles-repo already exists!
222 229 [255]
223 230
224 231 add another largefile to the new largefiles repo
225 232 $ cd largefiles-repo
226 233 $ dd if=/dev/zero bs=1k count=1k > anotherlarge 2> /dev/null
227 234 $ hg add --lfsize=1 anotherlarge
228 235 $ hg commit -m "add anotherlarge (should be a largefile)"
229 236 $ cat .hglf/anotherlarge
230 237 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
231 238 $ hg tag mytag
232 239 $ cd ..
233 240
234 241 round-trip: converting back to a normal (non-largefiles) repo with
235 242 "lfconvert --to-normal" should give the same as ../bigfile-repo. The
236 243 convert extension is disabled to show config items can be loaded without it.
237 244 $ cd largefiles-repo
238 245 $ hg --config extensions.convert=! lfconvert --to-normal . ../normal-repo
239 246 initializing destination ../normal-repo
240 247 0 additional largefiles cached
241 248 scanning source...
242 249 sorting...
243 250 converting...
244 251 7 add large, normal1
245 252 6 add sub/*
246 253 5 rename sub/ to stuff/
247 254 4 add normal3, modify sub/*
248 255 3 remove large, normal3
249 256 2 merge
250 257 1 add anotherlarge (should be a largefile)
251 258 0 Added tag mytag for changeset abacddda7028
252 259 $ cd ../normal-repo
253 260 $ cat >> .hg/hgrc <<EOF
254 261 > [extensions]
255 262 > largefiles = !
256 263 > EOF
257 264
258 265 $ hg log -G --template "{rev}:{node|short} {desc|firstline}\n"
259 266 o 7:b5fedc110b9d Added tag mytag for changeset 867ab992ecf4
260 267 |
261 268 o 6:867ab992ecf4 add anotherlarge (should be a largefile)
262 269 |
263 270 o 5:4884f215abda merge
264 271 |\
265 272 | o 4:7285f817b77e remove large, normal3
266 273 | |
267 274 | o 3:67e3892e3534 add normal3, modify sub/*
268 275 | |
269 276 o | 2:c96c8beb5d56 rename sub/ to stuff/
270 277 |/
271 278 o 1:020c65d24e11 add sub/*
272 279 |
273 280 o 0:117b8328f97a add large, normal1
274 281
275 282 $ hg update
276 283 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
277 284 $ hg locate
278 285 .hgtags
279 286 anotherlarge
280 287 normal1
281 288 stuff/maybelarge.dat
282 289 stuff/normal2
283 290 $ [ -d .hg/largefiles ] && echo fail || echo pass
284 291 pass
285 292
286 293 $ cd ..
287 294
288 295 Clearing the usercache ensures that commitctx doesn't try to cache largefiles
289 296 from the working dir on a convert.
290 297 $ rm "${USERCACHE}"/*
291 298 $ hg convert largefiles-repo
292 299 assuming destination largefiles-repo-hg
293 300 initializing destination largefiles-repo-hg repository
294 301 scanning source...
295 302 sorting...
296 303 converting...
297 304 7 add large, normal1
298 305 6 add sub/*
299 306 5 rename sub/ to stuff/
300 307 4 add normal3, modify sub/*
301 308 3 remove large, normal3
302 309 2 merge
303 310 1 add anotherlarge (should be a largefile)
304 311 0 Added tag mytag for changeset abacddda7028
305 312
306 313 $ hg -R largefiles-repo-hg log -G --template "{rev}:{node|short} {desc|firstline}\n"
307 314 o 7:2f08f66459b7 Added tag mytag for changeset 17126745edfd
308 315 |
309 316 o 6:17126745edfd add anotherlarge (should be a largefile)
310 317 |
311 318 o 5:9cc5aa7204f0 merge
312 319 |\
313 320 | o 4:a5a02de7a8e4 remove large, normal3
314 321 | |
315 322 | o 3:55759520c76f add normal3, modify sub/*
316 323 | |
317 324 o | 2:261ad3f3f037 rename sub/ to stuff/
318 325 |/
319 326 o 1:334e5237836d add sub/*
320 327 |
321 328 o 0:d4892ec57ce2 add large, normal1
322 329
323 330 Verify will fail (for now) if the usercache is purged before converting, since
324 331 largefiles are not cached in the converted repo's local store by the conversion
325 332 process.
326 333 $ cd largefiles-repo-hg
327 334 $ cat >> .hg/hgrc <<EOF
328 335 > [experimental]
329 336 > evolution.createmarkers=True
330 337 > EOF
331 338 $ hg debugobsolete `hg log -r tip -T "{node}"`
332 339 obsoleted 1 changesets
333 340 $ cd ..
334 341
335 342 $ hg -R largefiles-repo-hg verify --large --lfa
336 343 checking changesets
337 344 checking manifests
338 345 crosschecking files in changesets and manifests
339 346 checking files
340 347 checked 8 changesets with 13 changes to 9 files
341 348 searching 7 changesets for largefiles
342 349 changeset 0:d4892ec57ce2: large references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/2e000fa7e85759c7f4c254d4d9c33ef481e459a7
343 350 changeset 1:334e5237836d: sub/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c
344 351 changeset 2:261ad3f3f037: stuff/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c
345 352 changeset 3:55759520c76f: sub/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/76236b6a2c6102826c61af4297dd738fb3b1de38
346 353 changeset 5:9cc5aa7204f0: stuff/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/76236b6a2c6102826c61af4297dd738fb3b1de38
347 354 changeset 6:17126745edfd: anotherlarge references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
348 355 verified existence of 6 revisions of 4 largefiles
349 356 [1]
350 357 $ hg -R largefiles-repo-hg showconfig paths
351 358 [1]
352 359
353 360
354 361 Avoid a traceback if a largefile isn't available (issue3519)
355 362
356 363 Ensure the largefile can be cached in the source if necessary
357 364 $ hg clone -U largefiles-repo issue3519
358 365 $ rm -f "${USERCACHE}"/*
359 366 $ hg lfconvert --to-normal issue3519 normalized3519
360 367 initializing destination normalized3519
361 368 4 additional largefiles cached
362 369 scanning source...
363 370 sorting...
364 371 converting...
365 372 7 add large, normal1
366 373 6 add sub/*
367 374 5 rename sub/ to stuff/
368 375 4 add normal3, modify sub/*
369 376 3 remove large, normal3
370 377 2 merge
371 378 1 add anotherlarge (should be a largefile)
372 379 0 Added tag mytag for changeset abacddda7028
373 380
374 381 Ensure the abort message is useful if a largefile is entirely unavailable
375 382 $ rm -rf normalized3519
376 383 $ rm "${USERCACHE}"/*
377 384 $ rm issue3519/.hg/largefiles/*
378 385 $ rm largefiles-repo/.hg/largefiles/*
379 386 $ hg lfconvert --to-normal issue3519 normalized3519
380 387 initializing destination normalized3519
381 388 anotherlarge: largefile 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3 not available from file:/*/$TESTTMP/largefiles-repo (glob)
382 389 stuff/maybelarge.dat: largefile 76236b6a2c6102826c61af4297dd738fb3b1de38 not available from file:/*/$TESTTMP/largefiles-repo (glob)
383 390 stuff/maybelarge.dat: largefile 76236b6a2c6102826c61af4297dd738fb3b1de38 not available from file:/*/$TESTTMP/largefiles-repo (glob)
384 391 sub/maybelarge.dat: largefile 76236b6a2c6102826c61af4297dd738fb3b1de38 not available from file:/*/$TESTTMP/largefiles-repo (glob)
385 392 large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:/*/$TESTTMP/largefiles-repo (glob)
386 393 sub/maybelarge.dat: largefile 76236b6a2c6102826c61af4297dd738fb3b1de38 not available from file:/*/$TESTTMP/largefiles-repo (glob)
387 394 large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:/*/$TESTTMP/largefiles-repo (glob)
388 395 stuff/maybelarge.dat: largefile 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c not available from file:/*/$TESTTMP/largefiles-repo (glob)
389 396 large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:/*/$TESTTMP/largefiles-repo (glob)
390 397 sub/maybelarge.dat: largefile 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c not available from file:/*/$TESTTMP/largefiles-repo (glob)
391 398 large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:/*/$TESTTMP/largefiles-repo (glob)
392 399 0 additional largefiles cached
393 400 11 largefiles failed to download
394 401 abort: all largefiles must be present locally
395 402 [255]
396 403
397 404
General Comments 0
You need to be logged in to leave comments. Login now