##// END OF EJS Templates
largefiles: expand test suite some more (test rebasing, rollback, update --clean, and verify --large)
Na'Tosha Bard -
r15297:3ef43402 stable
parent child Browse files
Show More
@@ -1,445 +1,619 b''
1 1 $ cat >> $HGRCPATH <<EOF
2 2 > [extensions]
3 3 > largefiles=
4 4 > purge=
5 5 > rebase=
6 6 > [largefiles]
7 7 > size=2
8 8 > patterns=glob:**.dat
9 9 > EOF
10 10
11 11 Create the repo with a couple of revisions of both large and normal
12 12 files (testing that status correctly shows largefiles.
13 13
14 14 $ hg init a
15 15 $ cd a
16 16 $ mkdir sub
17 17 $ echo normal1 > normal1
18 18 $ echo normal2 > sub/normal2
19 19 $ echo large1 > large1
20 20 $ echo large2 > sub/large2
21 21 $ hg add normal1 sub/normal2
22 22 $ hg add --large large1 sub/large2
23 23 $ hg commit -m "add files"
24 24 $ echo normal11 > normal1
25 25 $ echo normal22 > sub/normal2
26 26 $ echo large11 > large1
27 27 $ echo large22 > sub/large2
28 28 $ hg st
29 29 M large1
30 30 M normal1
31 31 M sub/large2
32 32 M sub/normal2
33 33 $ hg commit -m "edit files"
34 34
35 35 Verify that committing new versions of largefiles results in correct
36 36 largefile contents, and also that non-largefiles are not affected
37 37 badly.
38 38
39 39 $ cat normal1
40 40 normal11
41 41 $ cat large1
42 42 large11
43 43 $ cat sub/normal2
44 44 normal22
45 45 $ cat sub/large2
46 46 large22
47 47
48 48 Verify removing largefiles and normal files works on largefile repos.
49 49
50 50 $ hg remove normal1 large1
51 51 $ hg commit -m "remove files"
52 52 $ ls
53 53 sub
54 54
55 55 Test copying largefiles.
56 56
57 57 $ hg cp sub/normal2 normal1
58 58 $ hg cp sub/large2 large1
59 59 $ hg commit -m "copy files"
60 60 $ cat normal1
61 61 normal22
62 62 $ cat large1
63 63 large22
64 64
65 65 Test moving largefiles and verify that normal files are also unaffected.
66 66
67 67 $ hg mv normal1 normal3
68 68 $ hg mv large1 large3
69 69 $ hg mv sub/normal2 sub/normal4
70 70 $ hg mv sub/large2 sub/large4
71 71 $ hg commit -m "move files"
72 72 $ cat normal3
73 73 normal22
74 74 $ cat large3
75 75 large22
76 76 $ cat sub/normal4
77 77 normal22
78 78 $ cat sub/large4
79 79 large22
80 80
81 81 Test archiving the various revisions. These hit corner cases known with
82 82 archiving.
83 83
84 84 $ hg archive -r 0 ../archive0
85 85 $ hg archive -r 1 ../archive1
86 86 $ hg archive -r 2 ../archive2
87 87 $ hg archive -r 3 ../archive3
88 88 $ hg archive -r 4 ../archive4
89 89 $ cd ../archive0
90 90 $ cat normal1
91 91 normal1
92 92 $ cat large1
93 93 large1
94 94 $ cat sub/normal2
95 95 normal2
96 96 $ cat sub/large2
97 97 large2
98 98 $ cd ../archive1
99 99 $ cat normal1
100 100 normal11
101 101 $ cat large1
102 102 large11
103 103 $ cat sub/normal2
104 104 normal22
105 105 $ cat sub/large2
106 106 large22
107 107 $ cd ../archive2
108 108 $ ls
109 109 sub
110 110 $ cat sub/normal2
111 111 normal22
112 112 $ cat sub/large2
113 113 large22
114 114 $ cd ../archive3
115 115 $ cat normal1
116 116 normal22
117 117 $ cat large1
118 118 large22
119 119 $ cat sub/normal2
120 120 normal22
121 121 $ cat sub/large2
122 122 large22
123 123 $ cd ../archive4
124 124 $ cat normal3
125 125 normal22
126 126 $ cat large3
127 127 large22
128 128 $ cat sub/normal4
129 129 normal22
130 130 $ cat sub/large4
131 131 large22
132 132
133 133 Test a separate commit corner case (specifying files to commit) and check
134 134 that the commited files have the right value.
135 135
136 136 $ cd ../a
137 137 $ echo normal3 > normal3
138 138 $ echo large3 > large3
139 139 $ echo normal4 > sub/normal4
140 140 $ echo large4 > sub/large4
141 141 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
142 142 $ cat normal3
143 143 normal3
144 144 $ cat large3
145 145 large3
146 146 $ cat sub/normal4
147 147 normal4
148 148 $ cat sub/large4
149 149 large4
150 150
151 151 Test one more commit corner case that has been known to break (comitting from
152 152 a sub-directory of the repo).
153 153
154 154 $ cd ../a
155 155 $ echo normal33 > normal3
156 156 $ echo large33 > large3
157 157 $ echo normal44 > sub/normal4
158 158 $ echo large44 > sub/large4
159 159 $ cd sub
160 160 $ hg commit -m "edit files yet again"
161 161 $ cat ../normal3
162 162 normal33
163 163 $ cat ../large3
164 164 large33
165 165 $ cat normal4
166 166 normal44
167 167 $ cat large4
168 168 large44
169 169
170 170 Check that committing standins is not allowed.
171 171
172 172 $ cd ..
173 173 $ echo large3 > large3
174 174 $ hg commit .hglf/large3 -m "try to commit standin"
175 175 abort: file ".hglf/large3" is a largefile standin
176 176 (commit the largefile itself instead)
177 177 [255]
178 178
179 179 Test some cornercases for adding largefiles.
180 180
181 181 $ echo large5 > large5
182 182 $ hg add --large large5
183 183 $ hg add --large large5
184 184 large5 already a largefile
185 185 $ mkdir sub2
186 186 $ echo large6 > sub2/large6
187 187 $ echo large7 > sub2/large7
188 188 $ hg add --large sub2
189 189 adding sub2/large6 as a largefile
190 190 adding sub2/large7 as a largefile
191 191 $ hg st
192 192 M large3
193 193 A large5
194 194 A sub2/large6
195 195 A sub2/large7
196 196
197 197 Test that files get added as largefiles based on .hgrc settings
198 198
199 199 $ echo testdata > test.dat
200 200 $ dd bs=3145728 count=1 if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
201 201 $ hg add
202 202 adding reallylarge as a largefile
203 203 adding test.dat as a largefile
204 204 $ dd bs=1048576 count=1 if=/dev/zero of=reallylarge2 > /dev/null 2> /dev/null
205 205
206 206 Test that specifying the --lsize command on the comand-line works
207 207
208 208 $ hg add --lfsize 1
209 209 adding reallylarge2 as a largefile
210 210
211 211 Test forget on largefiles.
212 212
213 213 $ hg forget large3 large5 test.dat reallylarge reallylarge2
214 214 $ hg st
215 215 A sub2/large6
216 216 A sub2/large7
217 217 R large3
218 218 ? large5
219 219 ? reallylarge
220 220 ? reallylarge2
221 221 ? test.dat
222 222 $ hg commit -m "add/edit more largefiles"
223 223 $ hg st
224 224 ? large3
225 225 ? large5
226 226 ? reallylarge
227 227 ? reallylarge2
228 228 ? test.dat
229 229
230 230 Test purge with largefiles (verify that largefiles get populated in the
231 231 working copy correctly after a purge)
232 232
233 233 $ hg purge --all
234 234 $ cat sub/large4
235 235 large44
236 236 $ cat sub2/large6
237 237 large6
238 238 $ cat sub2/large7
239 239 large7
240 240
241 241 Test cloning a largefiles repo.
242 242
243 243 $ cd ..
244 244 $ hg clone a b
245 245 updating to branch default
246 246 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
247 247 getting changed largefiles
248 248 3 largefiles updated, 0 removed
249 249 $ cd b
250 250 $ hg log
251 251 changeset: 7:daea875e9014
252 252 tag: tip
253 253 user: test
254 254 date: Thu Jan 01 00:00:00 1970 +0000
255 255 summary: add/edit more largefiles
256 256
257 257 changeset: 6:4355d653f84f
258 258 user: test
259 259 date: Thu Jan 01 00:00:00 1970 +0000
260 260 summary: edit files yet again
261 261
262 262 changeset: 5:9d5af5072dbd
263 263 user: test
264 264 date: Thu Jan 01 00:00:00 1970 +0000
265 265 summary: edit files again
266 266
267 267 changeset: 4:74c02385b94c
268 268 user: test
269 269 date: Thu Jan 01 00:00:00 1970 +0000
270 270 summary: move files
271 271
272 272 changeset: 3:9e8fbc4bce62
273 273 user: test
274 274 date: Thu Jan 01 00:00:00 1970 +0000
275 275 summary: copy files
276 276
277 277 changeset: 2:51a0ae4d5864
278 278 user: test
279 279 date: Thu Jan 01 00:00:00 1970 +0000
280 280 summary: remove files
281 281
282 282 changeset: 1:ce8896473775
283 283 user: test
284 284 date: Thu Jan 01 00:00:00 1970 +0000
285 285 summary: edit files
286 286
287 287 changeset: 0:30d30fe6a5be
288 288 user: test
289 289 date: Thu Jan 01 00:00:00 1970 +0000
290 290 summary: add files
291 291
292 292 $ cat normal3
293 293 normal33
294 294 $ cat sub/normal4
295 295 normal44
296 296 $ cat sub/large4
297 297 large44
298 298 $ cat sub2/large6
299 299 large6
300 300 $ cat sub2/large7
301 301 large7
302 302 $ cd ..
303 303 $ hg clone a -r 3 c
304 304 adding changesets
305 305 adding manifests
306 306 adding file changes
307 307 added 4 changesets with 10 changes to 4 files
308 308 updating to branch default
309 309 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
310 310 getting changed largefiles
311 311 2 largefiles updated, 0 removed
312 312 $ cd c
313 313 $ hg log
314 314 changeset: 3:9e8fbc4bce62
315 315 tag: tip
316 316 user: test
317 317 date: Thu Jan 01 00:00:00 1970 +0000
318 318 summary: copy files
319 319
320 320 changeset: 2:51a0ae4d5864
321 321 user: test
322 322 date: Thu Jan 01 00:00:00 1970 +0000
323 323 summary: remove files
324 324
325 325 changeset: 1:ce8896473775
326 326 user: test
327 327 date: Thu Jan 01 00:00:00 1970 +0000
328 328 summary: edit files
329 329
330 330 changeset: 0:30d30fe6a5be
331 331 user: test
332 332 date: Thu Jan 01 00:00:00 1970 +0000
333 333 summary: add files
334 334
335 335 $ cat normal1
336 336 normal22
337 337 $ cat large1
338 338 large22
339 339 $ cat sub/normal2
340 340 normal22
341 341 $ cat sub/large2
342 342 large22
343 343
344 344 Test that old revisions of a clone have correct largefiles content. This also
345 345 tsts update.
346 346
347 347 $ hg update -r 1
348 348 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
349 349 getting changed largefiles
350 350 1 largefiles updated, 0 removed
351 351 $ cat large1
352 352 large11
353 353 $ cat sub/large2
354 354 large22
355 355
356 356 Test that rebasing between two repositories does not revert largefiles to old
357 357 revisions (this was a very bad bug that took a lot of work to fix).
358 358
359 359 $ cd ..
360 360 $ hg clone a d
361 361 updating to branch default
362 362 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
363 363 getting changed largefiles
364 364 3 largefiles updated, 0 removed
365 365 $ cd b
366 366 $ echo large4-modified > sub/large4
367 367 $ echo normal3-modified > normal3
368 368 $ hg commit -m "modify normal file and largefile in repo b"
369 369 $ cd ../d
370 370 $ echo large6-modified > sub2/large6
371 371 $ echo normal4-modified > sub/normal4
372 372 $ hg commit -m "modify normal file largefile in repo d"
373 $ cd ..
374 $ hg clone d e
375 updating to branch default
376 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
377 getting changed largefiles
378 3 largefiles updated, 0 removed
379 $ cd d
373 380 $ hg pull --rebase ../b
374 381 pulling from ../b
375 382 searching for changes
376 383 adding changesets
377 384 adding manifests
378 385 adding file changes
379 386 added 1 changesets with 2 changes to 2 files (+1 heads)
380 387 getting changed largefiles
381 388 1 largefiles updated, 0 removed
382 389 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg
383 390 nothing to rebase
384 391 $ hg log
385 392 changeset: 9:598410d3eb9a
386 393 tag: tip
387 394 user: test
388 395 date: Thu Jan 01 00:00:00 1970 +0000
389 396 summary: modify normal file largefile in repo d
390 397
391 398 changeset: 8:a381d2c8c80e
392 399 user: test
393 400 date: Thu Jan 01 00:00:00 1970 +0000
394 401 summary: modify normal file and largefile in repo b
395 402
396 403 changeset: 7:daea875e9014
397 404 user: test
398 405 date: Thu Jan 01 00:00:00 1970 +0000
399 406 summary: add/edit more largefiles
400 407
401 408 changeset: 6:4355d653f84f
402 409 user: test
403 410 date: Thu Jan 01 00:00:00 1970 +0000
404 411 summary: edit files yet again
405 412
406 413 changeset: 5:9d5af5072dbd
407 414 user: test
408 415 date: Thu Jan 01 00:00:00 1970 +0000
409 416 summary: edit files again
410 417
411 418 changeset: 4:74c02385b94c
412 419 user: test
413 420 date: Thu Jan 01 00:00:00 1970 +0000
414 421 summary: move files
415 422
416 423 changeset: 3:9e8fbc4bce62
417 424 user: test
418 425 date: Thu Jan 01 00:00:00 1970 +0000
419 426 summary: copy files
420 427
421 428 changeset: 2:51a0ae4d5864
422 429 user: test
423 430 date: Thu Jan 01 00:00:00 1970 +0000
424 431 summary: remove files
425 432
426 433 changeset: 1:ce8896473775
427 434 user: test
428 435 date: Thu Jan 01 00:00:00 1970 +0000
429 436 summary: edit files
430 437
431 438 changeset: 0:30d30fe6a5be
432 439 user: test
433 440 date: Thu Jan 01 00:00:00 1970 +0000
434 441 summary: add files
435 442
436 443 $ cat normal3
437 444 normal3-modified
438 445 $ cat sub/normal4
439 446 normal4-modified
440 447 $ cat sub/large4
441 448 large4-modified
442 449 $ cat sub2/large6
443 450 large6-modified
444 451 $ cat sub2/large7
445 452 large7
453 $ cd ../e
454 $ hg pull ../b
455 pulling from ../b
456 searching for changes
457 adding changesets
458 adding manifests
459 adding file changes
460 added 1 changesets with 2 changes to 2 files (+1 heads)
461 (run 'hg heads' to see heads, 'hg merge' to merge)
462 $ hg rebase
463 getting changed largefiles
464 1 largefiles updated, 0 removed
465 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg
466 $ hg log
467 changeset: 9:598410d3eb9a
468 tag: tip
469 user: test
470 date: Thu Jan 01 00:00:00 1970 +0000
471 summary: modify normal file largefile in repo d
472
473 changeset: 8:a381d2c8c80e
474 user: test
475 date: Thu Jan 01 00:00:00 1970 +0000
476 summary: modify normal file and largefile in repo b
477
478 changeset: 7:daea875e9014
479 user: test
480 date: Thu Jan 01 00:00:00 1970 +0000
481 summary: add/edit more largefiles
482
483 changeset: 6:4355d653f84f
484 user: test
485 date: Thu Jan 01 00:00:00 1970 +0000
486 summary: edit files yet again
487
488 changeset: 5:9d5af5072dbd
489 user: test
490 date: Thu Jan 01 00:00:00 1970 +0000
491 summary: edit files again
492
493 changeset: 4:74c02385b94c
494 user: test
495 date: Thu Jan 01 00:00:00 1970 +0000
496 summary: move files
497
498 changeset: 3:9e8fbc4bce62
499 user: test
500 date: Thu Jan 01 00:00:00 1970 +0000
501 summary: copy files
502
503 changeset: 2:51a0ae4d5864
504 user: test
505 date: Thu Jan 01 00:00:00 1970 +0000
506 summary: remove files
507
508 changeset: 1:ce8896473775
509 user: test
510 date: Thu Jan 01 00:00:00 1970 +0000
511 summary: edit files
512
513 changeset: 0:30d30fe6a5be
514 user: test
515 date: Thu Jan 01 00:00:00 1970 +0000
516 summary: add files
517
518 $ cat normal3
519 normal3-modified
520 $ cat sub/normal4
521 normal4-modified
522 $ cat sub/large4
523 large4-modified
524 $ cat sub2/large6
525 large6-modified
526 $ cat sub2/large7
527 large7
528
529 Test rollback on largefiles
530
531 $ echo large4-modified-again > sub/large4
532 $ hg commit -m "Modify large4 again"
533 $ hg rollback
534 repository tip rolled back to revision 9 (undo commit)
535 working directory now based on revision 9
536 $ hg st
537 M sub/large4
538 $ hg log
539 changeset: 9:598410d3eb9a
540 tag: tip
541 user: test
542 date: Thu Jan 01 00:00:00 1970 +0000
543 summary: modify normal file largefile in repo d
544
545 changeset: 8:a381d2c8c80e
546 user: test
547 date: Thu Jan 01 00:00:00 1970 +0000
548 summary: modify normal file and largefile in repo b
549
550 changeset: 7:daea875e9014
551 user: test
552 date: Thu Jan 01 00:00:00 1970 +0000
553 summary: add/edit more largefiles
554
555 changeset: 6:4355d653f84f
556 user: test
557 date: Thu Jan 01 00:00:00 1970 +0000
558 summary: edit files yet again
559
560 changeset: 5:9d5af5072dbd
561 user: test
562 date: Thu Jan 01 00:00:00 1970 +0000
563 summary: edit files again
564
565 changeset: 4:74c02385b94c
566 user: test
567 date: Thu Jan 01 00:00:00 1970 +0000
568 summary: move files
569
570 changeset: 3:9e8fbc4bce62
571 user: test
572 date: Thu Jan 01 00:00:00 1970 +0000
573 summary: copy files
574
575 changeset: 2:51a0ae4d5864
576 user: test
577 date: Thu Jan 01 00:00:00 1970 +0000
578 summary: remove files
579
580 changeset: 1:ce8896473775
581 user: test
582 date: Thu Jan 01 00:00:00 1970 +0000
583 summary: edit files
584
585 changeset: 0:30d30fe6a5be
586 user: test
587 date: Thu Jan 01 00:00:00 1970 +0000
588 summary: add files
589
590 $ cat sub/large4
591 large4-modified-again
592
593 Test that `update --clean` leaves correct largefiles in working copy.
594
595 $ hg update --clean
596 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
597 getting changed largefiles
598 1 largefiles updated, 0 removed
599 $ cat normal3
600 normal3-modified
601 $ cat sub/normal4
602 normal4-modified
603 $ cat sub/large4
604 large4-modified
605 $ cat sub2/large6
606 large6-modified
607 $ cat sub2/large7
608 large7
609
610 Test that verify --large actaully verifies largefiles
611
612 $ hg verify --large
613 checking changesets
614 checking manifests
615 crosschecking files in changesets and manifests
616 checking files
617 10 files, 10 changesets, 28 total revisions
618 searching 1 changesets for largefiles
619 verified existence of 3 revisions of 3 largefiles
General Comments 0
You need to be logged in to leave comments. Login now