remotefilelog: local loosefiles should always be fully repacked

Summary:
The loosefiles repack was made incremental to greatly reduce the repack time
for users. Since the amount of local loosefiles should be way smaller than the
amount of shared ones, let's always run a full repack on the former. This
should allow us to kill all the local loosefiles, which will help in no longer
supporting them.

Reviewed By: quark-zju

Differential Revision: D17135975

fbshipit-source-id: 9480993b31aa57d0d6e6b7caffd282929183f782
This commit is contained in:
Xavier Deguillard 2019-08-30 15:07:35 -07:00 committed by Facebook Github Bot
parent 91462ec10e
commit 4b28370d5e
2 changed files with 17 additions and 25 deletions

View File

@ -152,29 +152,23 @@ def _shareddatastoresrepack(repo, options, incremental):
def _localdatapythonrepack(repo, options, packpath, incremental):
if incremental:
_incrementalrepack(
repo,
repo.fileslog.localdatastores,
repo.fileslog.localhistorystores,
packpath,
constants.FILEPACK_CATEGORY,
options=options,
shared=False,
)
else:
datasource = contentstore.unioncontentstore(*repo.fileslog.localdatastores)
historysource = metadatastore.unionmetadatastore(
*repo.fileslog.localhistorystores, allowincomplete=True
)
_runrepack(
repo,
datasource,
historysource,
packpath,
constants.FILEPACK_CATEGORY,
options=options,
shared=False,
)
# Always do a full repack of the local loosefiles.
options = dict(options)
options["incremental"] = False
datasource = contentstore.unioncontentstore(*repo.fileslog.localdatastores)
historysource = metadatastore.unionmetadatastore(
*repo.fileslog.localhistorystores, allowincomplete=True
)
_runrepack(
repo,
datasource,
historysource,
packpath,
constants.FILEPACK_CATEGORY,
options=options,
shared=False,
)
def _localdatarepack(repo, options, incremental):

View File

@ -16,5 +16,3 @@
$ hg repack --incremental --config remotefilelog.localdatarepack=True
$ findfilessorted .hg/store/data
.hg/store/data/11f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0
.hg/store/data/11f6ad8ec52a2984abaafd7c3b516503785c2072/filename