Commit Graph

11 Commits

Author SHA1 Message Date
Aida Getoeva
996ac6da37 prefetch: add requestpacks
Summary: Implemented logic for fetching data from the scmmemcache and the server in pack files format. By default `prefetch` will still use loose files, unless the `remotefilelog.fetchpacks` config flag will be set to true.

Differential Revision: D13905733

fbshipit-source-id: cc559f5bc600067199a91efe6cf44b1bde6bf69b
2019-02-06 10:43:15 -08:00
Saurabh Singh
3649a1fbef repack: fix test by using compatible flag in touch command
Summary:
D13646642 used the `--date` flag for the `touch` command which
unfortunately does not work on our prod OSX hosts. Therefore, lets switch to
the more compatible `-t` flag.

Reviewed By: DurhamG

Differential Revision: D13673021

fbshipit-source-id: 6f9e0234e7fd3d4c345bedecdd2197949d71c420
2019-01-15 09:47:17 -08:00
Xavier Deguillard
678fd5c0fe remotefilelog: Remove old temporary files.
Summary:
We've observed some users with very large hgcache directories that were filled
with temporary pack files that for some reasons were not removed/renamed on a
previous repack.

These files can appear due to a variety of reasons, such as forcibly killing
hg, or a host power-off, or simply due to a bug in mercurial. It is likely that
the later case is what causes some of the hgcache directories to grow and this
patch doesn't attempt on finding the underlying mercurial issue. Rather, let's
alleviate the issue by simply removing the temporary files older than 24h.

Reviewed By: ikostia

Differential Revision: D13646642

fbshipit-source-id: faa0605e322d440a75187e2517cbbcb13031dae0
2019-01-14 14:56:54 -08:00
Jun Wu
4b5df986f1 remotefilelog: use latest supported version for mutabledatapack
Summary:
This fixes LFS compatibility with packlocaldata.

Also drop the config as the default version is 1 now.

Reviewed By: DurhamG

Differential Revision: D13469486

fbshipit-source-id: 1dc4a1051667419d7aab97bf95f93cacd166468a
2018-12-15 16:27:04 -08:00
Durham Goode
718d19fce6 datapack: fix not including rename information in datapack blobs
Summary:
It turns out data packs contain the exact mercurial file blob,
including the rename metadata header. This is different from how loose files work, which
contain the non-headered text and instead store the rename in the history at the
end of the file.

Ideally we'd change datapacks to not store the metadata version of the file, but
unfortunately this is how it has always been, so instead we must change the
commit-straight-to-pack code to write the headered blob.

Differential Revision: D12936247

fbshipit-source-id: 3f909d2964d7f7200ac0e31e47bd195b0c9b03e5
2018-11-06 14:06:55 -08:00
Mark Thomas
b10c8ada95 remotefilelog: add incremental repack for local data
Summary:
The incremental repack implementation omits repacking local data - it was
recently added for full repack, but not incremental repack.  Add it to
incremental repack.

We also don't run `_deletebigpacks` for non-shared data, as that data is
only stored locally.

Reviewed By: DurhamG

Differential Revision: D10525957

fbshipit-source-id: 012d7e8d455ac607773fc7013dcc4df0881665e8
2018-10-26 01:16:13 -07:00
Mark Thomas
02a0c8503d remotefilelog: store loose file filenames alongside the data
Summary:
Loose files don't contain the original filename inside them, but rather the
directory name is based on the sha1 hash of the filename.  This means that
given a remotefilelog data file, we can't find out the name of the file that
it contains.

Repack needs to know this (plus it's also useful for debug purposes), so add
an additional file in the directory, `filename`, which contains the original
filename of all the data files in the directory.

It follows that `sha1(read(filename)) == basename(dirname(filename))`

Reviewed By: DurhamG

Differential Revision: D10516851

fbshipit-source-id: aeeb1a116e0d50a134c274c3bb31c7c26aa8015c
2018-10-26 01:16:13 -07:00
Aida Getoeva
57eaddb3b9 loose files: packing loose files for local data
Summary: Packing loose files for local data into `.hg/store/packs`. Existing pack files for local data can also be repacked.

Reviewed By: DurhamG

Differential Revision: D9181106

fbshipit-source-id: 4d044e97178b4263b87404357445b43eb99017b3
2018-08-20 04:34:48 -07:00
Phil Cohen
67a6bf19bd add repack --looseonly
Summary:
It can sometimes be nice to be able to just repack loose data and avoid existing packs.

This came up during building the megarepo, which creates many loose files, but including the packs added too much repack time.

Differential Revision: D7209296

fbshipit-source-id: 10afed40e409733e0ee004f025013cf86f3f7bf6
2018-04-13 21:51:30 -07:00
Jun Wu
1cde63d99c codemod: drop hacks changing PYTHONPATH in tests
Summary:
Now they are unnecessary since `run-tests.py` will set up `PYTONPATH`
correctly.

Differential Revision: D6865042

fbshipit-source-id: ca95314f725968e14349a9d916434aa832c596f9
2018-04-13 21:51:00 -07:00
Durham Goode
fe980ff373 remotefilelog: move to hgext/
Summary:
Moves the remotefilelog extension into hgext/ and it's tests into
tests/.

I did not fix up all the check-module errors, since it's a ton of work for
very little impact at this point.

Test Plan: make local && ./run-tests.py

Reviewers: #mercurial

Differential Revision: https://phabricator.intern.facebook.com/D6680030
2018-01-08 18:58:08 -08:00