mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
repack: add incremental tree repacking
Summary: Previously we only supported full repacks of the manifest stores. This patch adds incremental repacking for both the shared manifest store and the local manifest store. Test Plan: Did a few pulls to produce a few treemanifest pack files. Ran hg repack --incremental after each one and verified it was a no-op until there were enough pack files to trigger the repack. Will add tests later today. Reviewers: #mercurial, rmcelroy Reviewed By: rmcelroy Subscribers: mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4260602 Signature: t1:4260602:1480705304:b17d3ec5ff8d4caafe935b2c4e941454052fe3ec
This commit is contained in:
parent
046fb2ca08
commit
edd8b25c30
@ -60,6 +60,25 @@ def incrementalrepack(repo):
|
||||
packpath,
|
||||
constants.FILEPACK_CATEGORY)
|
||||
|
||||
if util.safehasattr(repo.svfs, 'manifestdatastore'):
|
||||
# Repack the shared manifest store
|
||||
packpath = shallowutil.getcachepackpath(repo,
|
||||
constants.TREEPACK_CATEGORY)
|
||||
_incrementalrepack(repo,
|
||||
repo.svfs.sharedmanifestdatastores,
|
||||
metadatastore.unionmetadatastore(),
|
||||
packpath,
|
||||
constants.TREEPACK_CATEGORY)
|
||||
|
||||
# Repack the local manifest store
|
||||
packpath = shallowutil.getlocalpackpath(repo.svfs.vfs.base,
|
||||
constants.TREEPACK_CATEGORY)
|
||||
_incrementalrepack(repo,
|
||||
repo.svfs.localmanifestdatastores,
|
||||
metadatastore.unionmetadatastore(),
|
||||
packpath,
|
||||
constants.TREEPACK_CATEGORY)
|
||||
|
||||
def _incrementalrepack(repo, datastore, historystore, packpath, category):
|
||||
shallowutil.mkstickygroupdir(repo.ui, packpath)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user