sapling/eden/scm/tests/test-fb-hgext-remotefilelog-ruststores-repack.t
Xavier Deguillard d404b0a228 revisionstore: revamp repack to ease file format migration
Summary:
One of the main drawback of the current version of repack is that it writes
back the data to a packfile, making it hard to change file format. Currently, 2
file format changes are ongoing: moving away from packfiles entirely, and
moving from having LFS pointers stored in the packfiles, to a separate storage.

While an ad-hoc solution could be designed for this purpose, repack can
fullfill this goal easily by simply writing to the ContentStore, the
configuration of the ContentStore will then decide where this data will
be written into.

The main drawback of this code is the unfortunate added duplication of code.
I'm sure there is a way to avoid it by having new traits, I decided against it
for now from a code readability point of view.

Reviewed By: DurhamG

Differential Revision: D20567118

fbshipit-source-id: d67282dae31db93739e50f8cc64f9ecce92d2d30
2020-03-26 19:02:48 -07:00

55 lines
2.3 KiB
Raku

#chg-compatible
$ . "$TESTDIR/library.sh"
$ newserver master
$ clone master shallow --noupdate
$ cd shallow
$ setconfig remotefilelog.useruststore=True worker.rustworkers=True remotefilelog.localdatarepack=True
$ echo x > x
$ hg commit -qAm x
$ echo y > y
$ hg commit -qAm y
$ findfilessorted .hg/store/packs
.hg/store/packs/2d66e09c3bf8a000428af1630d978127182e496e.dataidx
.hg/store/packs/2d66e09c3bf8a000428af1630d978127182e496e.datapack
.hg/store/packs/65749040bf285c8867cb0d12bdae7cbcac022a55.dataidx
.hg/store/packs/65749040bf285c8867cb0d12bdae7cbcac022a55.datapack
.hg/store/packs/c3399b56e035f73c3295276ed098235a08a0ed8c.histidx
.hg/store/packs/c3399b56e035f73c3295276ed098235a08a0ed8c.histpack
.hg/store/packs/ed1aaa9bfbf108367f595bdff7a706b587e188bc.histidx
.hg/store/packs/ed1aaa9bfbf108367f595bdff7a706b587e188bc.histpack
.hg/store/packs/manifests/1921bd3d3d8442c6f92cf8363675e538c36d062b.dataidx
.hg/store/packs/manifests/1921bd3d3d8442c6f92cf8363675e538c36d062b.datapack
.hg/store/packs/manifests/2105dd350da61d1a4f08cacbb82949d855edf5bb.histidx
.hg/store/packs/manifests/2105dd350da61d1a4f08cacbb82949d855edf5bb.histpack
.hg/store/packs/manifests/2bf8539e08195f796c4ada99d894c92b6447b73e.dataidx
.hg/store/packs/manifests/2bf8539e08195f796c4ada99d894c92b6447b73e.datapack
.hg/store/packs/manifests/a890c983659e18f095538fb20f217db4e7bb129d.histidx
.hg/store/packs/manifests/a890c983659e18f095538fb20f217db4e7bb129d.histpack
$ hg repack --debug --traceback
$ findfilessorted .hg/store/packs
.hg/store/packs/102e9c722b8edc89ad9e5a488ad8e5347bc7e213.dataidx
.hg/store/packs/102e9c722b8edc89ad9e5a488ad8e5347bc7e213.datapack
.hg/store/packs/ed6d1e892f0715dc798b5e31f8b5a546f6dc357f.histidx
.hg/store/packs/ed6d1e892f0715dc798b5e31f8b5a546f6dc357f.histpack
.hg/store/packs/manifests/7041e644145f0031dca8f552159e2bb2e30a9d62.dataidx
.hg/store/packs/manifests/7041e644145f0031dca8f552159e2bb2e30a9d62.datapack
.hg/store/packs/manifests/ab796727d5271e973a5f03cf927e0bc877a0fb53.histidx
.hg/store/packs/manifests/ab796727d5271e973a5f03cf927e0bc877a0fb53.histpack
# Verify that the data is still what we expect.
$ hg up null
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
$ hg up -r tip
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cat x
x
$ cat y
y