remotefilelog: add a config to use the Rust PackStore

Reviewed By: quark-zju

Differential Revision: D17187153

fbshipit-source-id: 57faa956598600e520dfea3cd05de981e5caae1c
This commit is contained in:
Xavier Deguillard 2019-09-05 10:19:14 -07:00 committed by Facebook Github Bot
parent 375d91a518
commit 0cd7a9cb8f
5 changed files with 24 additions and 5 deletions

View File

@ -128,6 +128,8 @@ Configs:
``remotefilelog.indexedloghistorystore`` use an IndexedLog history store.
``remotefilelog.userustpackstore`` use the Rust PackStore.
Configs for Eden API (HTTP data fetching):
``edenapi.enabled`` specifies whether HTTP data fetching should be used.

View File

@ -83,7 +83,10 @@ class datapackstore(basepack.basepackstore):
def makedatapackstore(ui, path, deletecorruptpacks=False):
return datapackstore(ui, path, deletecorruptpacks)
if ui.configbool("remotefilelog", "userustpackstore", False):
return revisionstore.datapackstore(path, deletecorruptpacks)
else:
return datapackstore(ui, path, deletecorruptpacks)
class memdatapack(object):

View File

@ -87,7 +87,10 @@ class historypackstore(basepack.basepackstore):
def makehistorypackstore(ui, path, deletecorruptpacks=False):
return historypackstore(ui, path, deletecorruptpacks)
if ui.configbool("remotefilelog", "userustpackstore", False):
return revisionstore.historypackstore(path, deletecorruptpacks)
else:
return historypackstore(ui, path, deletecorruptpacks)
class memhistorypack(object):

View File

@ -355,7 +355,14 @@ def _incrementalrepack(
datapacks = _topacks(
packpath, _computeincrementaldatapack(repo.ui, files), revisionstore.datapack
)
datapacks.extend(s for s in datastore if not isinstance(s, datapack.datapackstore))
datapacks.extend(
s
for s in datastore
if not (
isinstance(s, datapack.datapackstore)
or isinstance(s, revisionstore.datapackstore)
)
)
historypacks = _topacks(
packpath,
@ -363,7 +370,12 @@ def _incrementalrepack(
revisionstore.historypack,
)
historypacks.extend(
s for s in historystore if not isinstance(s, historypack.historypackstore)
s
for s in historystore
if not (
isinstance(s, historypack.historypackstore)
or isinstance(s, revisionstore.historypackstore)
)
)
# ``allhistory{files,packs}`` contains all known history packs, even ones we

View File

@ -713,7 +713,6 @@ def setuptreestores(repo, mfl):
)
# Data store
# TODO: support cstore.uniondatapackstore here
datastore = makedatapackstore(ui, packpath, deletecorruptpacks=True)
localdatastore = makedatapackstore(ui, localpackpath)
datastores = [datastore, localdatastore, mutablelocalstore, mutablesharedstore]