Occasionally, callers to hg repack prefer to skip loose objects and only
repack packfiles. This adds an option to do so.
Details
- Reviewers
durham - Group Reviewers
Restricted Project - Commits
- rFBHGX0c972d6cb3a8: repack: add --packsonly option to repack
Diff Detail
- Repository
- rFBHGX Facebook Mercurial Extensions
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Event Timeline
Will a future change add this to the incremental repack code?
remotefilelog/repack.py | ||
---|---|---|
44 | getpack is somewhat of an internal only function, and not really indicative of a pack store. In theory you could have a datapack (not a datapackstore) in the repo.shareddatastore collection which should be repacked as part of --packsonly, but wouldn't trigger this condition. Instead, it might be nice to create a PackOptions struct. Maybe attach it to the ledger, then each store can look at the options and decide what it should do. Stores related to loose objects could exclude them when they see the packonly option set. |
remotefilelog/basestore.py | ||
---|---|---|
59–60 ↗ | (On Diff #3330) | dict is kinda clunky here, maybe we could use attrs as Sidd suggested. |
Requesting changes mainly because I expect that one test to actually fail now, and am confused why it doesn't.
remotefilelog/basestore.py | ||
---|---|---|
59 ↗ | (On Diff #3336) | if options and options.get('packsonly'): |
remotefilelog/contentstore.py | ||
305 ↗ | (On Diff #3336) | We should probably use a constant for the option name, so we don't typo it somewhere. |
tests/test-treemanifest-repack.t | ||
184 | I think this test is checking that hg repack can repack from revlogs into pack files. So I would actually expect this to fail if you set --packsonly, since in that case the revlogs should not be inspected. |
tests/test-treemanifest-repack.t | ||
---|---|---|
184 | Ah, it's because I didn't patch serverepack(). I guess I should. |
remotefilelog/constants.py | ||
---|---|---|
34 ↗ | (On Diff #3377) | markledger |
getpack is somewhat of an internal only function, and not really indicative of a pack store. In theory you could have a datapack (not a datapackstore) in the repo.shareddatastore collection which should be repacked as part of --packsonly, but wouldn't trigger this condition. Instead, it might be nice to create a PackOptions struct. Maybe attach it to the ledger, then each store can look at the options and decide what it should do. Stores related to loose objects could exclude them when they see the packonly option set.