Changeset View
Changeset View
Standalone View
Standalone View
tests/test-lfs.t
Show First 20 Lines • Show All 779 Lines • ▼ Show 20 Line(s) | |||||
Repo with damaged lfs objects in any revision will fail verification. | Repo with damaged lfs objects in any revision will fail verification. | ||||
$ hg -R repo5 verify | $ hg -R repo5 verify | ||||
checking changesets | checking changesets | ||||
checking manifests | checking manifests | ||||
crosschecking files in changesets and manifests | crosschecking files in changesets and manifests | ||||
checking files | checking files | ||||
l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0 | l@1: unpacking 46a2f24864bc: integrity check failed on data/l:0 | ||||
large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0 | large@0: unpacking 2c531e0992ff: integrity check failed on data/large:0 | ||||
checked 5 changesets with 10 changes to 4 files | checked 5 changesets with 10 changes to 4 files | ||||
2 integrity errors encountered! | 2 integrity errors encountered! | ||||
(first damaged changeset appears to be 0) | (first damaged changeset appears to be 0) | ||||
[1] | [1] | ||||
Updates work after cloning a damaged repo, if the damaged lfs objects aren't in | Updates work after cloning a damaged repo, if the damaged lfs objects aren't in | ||||
the update destination. Those objects won't be added to the new repo's store | the update destination. Those objects won't be added to the new repo's store | ||||
because they aren't accessed. | because they aren't accessed. | ||||
▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Line(s) | store, and poison it. (The verify with a good remote now works.) | ||||
$ rm -r fromcorrupt/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e | $ rm -r fromcorrupt/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e | ||||
$ hg -R fromcorrupt verify -v | $ hg -R fromcorrupt verify -v | ||||
repository uses revlog format 1 | repository uses revlog format 1 | ||||
checking changesets | checking changesets | ||||
checking manifests | checking manifests | ||||
crosschecking files in changesets and manifests | crosschecking files in changesets and manifests | ||||
checking files | checking files | ||||
l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0 | l@1: unpacking 46a2f24864bc: integrity check failed on data/l:0 | ||||
lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store | ||||
large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0 | large@0: unpacking 2c531e0992ff: integrity check failed on data/large:0 | ||||
lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store | lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store | ||||
lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store | lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store | ||||
checked 5 changesets with 10 changes to 4 files | checked 5 changesets with 10 changes to 4 files | ||||
2 integrity errors encountered! | 2 integrity errors encountered! | ||||
(first damaged changeset appears to be 0) | (first damaged changeset appears to be 0) | ||||
[1] | [1] | ||||
$ hg -R fromcorrupt --config lfs.usercache=emptycache verify -v | $ hg -R fromcorrupt --config lfs.usercache=emptycache verify -v | ||||
repository uses revlog format 1 | repository uses revlog format 1 | ||||
Show All 25 Lines | usercache or local store. | ||||
$ test -f fromcorrupt2/.hg/store/lfs/objects/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $ test -f fromcorrupt2/.hg/store/lfs/objects/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | ||||
[1] | [1] | ||||
$ hg -R fromcorrupt2 verify | $ hg -R fromcorrupt2 verify | ||||
checking changesets | checking changesets | ||||
checking manifests | checking manifests | ||||
crosschecking files in changesets and manifests | crosschecking files in changesets and manifests | ||||
checking files | checking files | ||||
l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0 | l@1: unpacking 46a2f24864bc: integrity check failed on data/l:0 | ||||
large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0 | large@0: unpacking 2c531e0992ff: integrity check failed on data/large:0 | ||||
checked 5 changesets with 10 changes to 4 files | checked 5 changesets with 10 changes to 4 files | ||||
2 integrity errors encountered! | 2 integrity errors encountered! | ||||
(first damaged changeset appears to be 0) | (first damaged changeset appears to be 0) | ||||
[1] | [1] | ||||
Corrupt local files are not sent upstream. (The alternate dummy remote | Corrupt local files are not sent upstream. (The alternate dummy remote | ||||
avoids the corrupt lfs object in the original remote.) | avoids the corrupt lfs object in the original remote.) | ||||
$ mkdir $TESTTMP/dummy-remote2 | $ mkdir $TESTTMP/dummy-remote2 | ||||
$ hg init dest | $ hg init dest | ||||
$ hg -R fromcorrupt2 --config lfs.url=file:///$TESTTMP/dummy-remote2 push -v dest | $ hg -R fromcorrupt2 --config lfs.url=file:///$TESTTMP/dummy-remote2 push -v dest | ||||
pushing to dest | pushing to dest | ||||
searching for changes | searching for changes | ||||
lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store | ||||
abort: detected corrupt lfs object: 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e | abort: detected corrupt lfs object: 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e | ||||
(run hg verify) | (run hg verify) | ||||
[255] | [255] | ||||
$ hg -R fromcorrupt2 --config lfs.url=file:///$TESTTMP/dummy-remote2 verify -v | $ hg -R fromcorrupt2 --config lfs.url=file:///$TESTTMP/dummy-remote2 verify -v | ||||
repository uses revlog format 1 | repository uses revlog format 1 | ||||
checking changesets | checking changesets | ||||
checking manifests | checking manifests | ||||
crosschecking files in changesets and manifests | crosschecking files in changesets and manifests | ||||
checking files | checking files | ||||
l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0 | l@1: unpacking 46a2f24864bc: integrity check failed on data/l:0 | ||||
lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store | ||||
large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0 | large@0: unpacking 2c531e0992ff: integrity check failed on data/large:0 | ||||
lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store | lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store | ||||
lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store | lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store | ||||
checked 5 changesets with 10 changes to 4 files | checked 5 changesets with 10 changes to 4 files | ||||
2 integrity errors encountered! | 2 integrity errors encountered! | ||||
(first damaged changeset appears to be 0) | (first damaged changeset appears to be 0) | ||||
[1] | [1] | ||||
$ cat $TESTTMP/dummy-remote2/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256 | $ cat $TESTTMP/dummy-remote2/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256 | ||||
sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | ||||
$ cat fromcorrupt2/.hg/store/lfs/objects/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256 | $ cat fromcorrupt2/.hg/store/lfs/objects/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256 | ||||
sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | ||||
$ test -f $TESTTMP/dummy-remote2/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e | $ test -f $TESTTMP/dummy-remote2/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e | ||||
[1] | [1] | ||||
Accessing a corrupt file will complain | Accessing a corrupt file will complain | ||||
$ hg --cwd fromcorrupt2 cat -r 0 large | $ hg --cwd fromcorrupt2 cat -r 0 large | ||||
abort: integrity check failed on data/large.i:0 | abort: integrity check failed on data/large:0 | ||||
[50] | [50] | ||||
lfs -> normal -> lfs round trip conversions are possible. The 'none()' | lfs -> normal -> lfs round trip conversions are possible. The 'none()' | ||||
predicate on the command line will override whatever is configured globally and | predicate on the command line will override whatever is configured globally and | ||||
locally, and ensures everything converts to a regular file. For lfs -> normal, | locally, and ensures everything converts to a regular file. For lfs -> normal, | ||||
there's no 'lfs' destination repo requirement. For normal -> lfs, there is. | there's no 'lfs' destination repo requirement. For normal -> lfs, there is. | ||||
$ hg --config extensions.convert= --config 'lfs.track=none()' \ | $ hg --config extensions.convert= --config 'lfs.track=none()' \ | ||||
▲ Show 20 Lines • Show All 242 Lines • Show Last 20 Lines |