mirror of
https://github.com/facebook/sapling.git
synced 2025-01-06 04:43:19 +03:00
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:
parent
375d91a518
commit
0cd7a9cb8f
@ -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.
|
||||
|
@ -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):
|
||||
|
@ -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):
|
||||
|
@ -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
|
||||
|
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user