sapling/eden/scm/tests/test-fb-hgext-remotefilelog-ruststores-lfs-duplicated.t
Xavier Deguillard 21cd242dcf revisionstore: add a fallback remote lfs store
Summary:
If the LFS server is down, we are going to retry fetching filenode from the
Mercurial server directly, who is expected to not return a pointer.

Previously, this was achieved by adding a hack into `get_missing`, but since
the function is no longer called during prefetch calls, we cannot rely on it
anymore. Instead, we can wrap the regular remote store and translate all the
StoreKey::Content onto their corresponding hgid keys.

Reviewed By: DurhamG

Differential Revision: D22565604

fbshipit-source-id: 2532a1fc3dfd9ba5600957ed5cf905255cb5b3fd
2020-07-28 10:51:38 -07:00

31 lines
1023 B
Raku

#chg-compatible
$ newserver master
$ setconfig extensions.lfs= lfs.url=file:$TESTTMP/lfs-server
$ clone master shallow --noupdate
$ switchrepo shallow
$ setconfig extensions.lfs= lfs.url=file:$TESTTMP/lfs-server lfs.threshold=10B
$ echo "THIS IS AN LFS BLOB" > x
$ hg commit -qAm x
# Copy the packfiles that contain LFS pointers before they get removed by the following repack.
$ cp .hg/store/packs/*.data{pack,idx} $TESTTMP
$ setconfig remotefilelog.lfs=True remotefilelog.localdatarepack=True
$ hg repack
# Copy back the packfiles. We now have a filenode with pointer in 2 different location, the packfile, and the lfs store.
$ cp "$TESTTMP/"*.data{pack,idx} .hg/store/packs
# Make sure that bundle isn't confused by this.
$ hg bundle -q -r . $TESTTMP/test-bundle
$ clone master shallow2 --noupdate
$ switchrepo shallow2
$ setconfig remotefilelog.lfs=True lfs.url=file:$TESTTMP/lfs-server lfs.threshold=10GB
$ hg unbundle -q -u $TESTTMP/test-bundle
$ cat x
THIS IS AN LFS BLOB