mirror of
https://github.com/facebook/sapling.git
synced 2025-01-06 04:43:19 +03:00
remotefilelog: Rust repack is the default
Summary: Rust repack has been the default for a while now. Let's stop pretending we're going to switch back to the Python repack by removing the config entirely. Reviewed By: quark-zju Differential Revision: D17135977 fbshipit-source-id: 5aaa0faa48e2b40a7314d5ab455f5eeaa4e4984d
This commit is contained in:
parent
b178492317
commit
6e0b6a2161
@ -83,8 +83,6 @@ Configs:
|
||||
``remotefilelog.history.repacksizelimit`` the maximum total size of pack
|
||||
files to include in an incremental history repack.
|
||||
|
||||
``remotefilelog.userustrepack`` use rust based repack implementation.
|
||||
|
||||
``remotefilelog.packsonlyrepack`` only repack packfiles during background
|
||||
repacks.
|
||||
|
||||
|
@ -80,10 +80,6 @@ def backgroundrepack(repo, incremental=True, packsonly=False, looseonly=False):
|
||||
runshellcommand(cmd, encoding.environ)
|
||||
|
||||
|
||||
def _userustrepack(repo):
|
||||
return repo.ui.configbool("remotefilelog", "userustrepack", True)
|
||||
|
||||
|
||||
def _runrustrepack(repo, options, packpath, incremental, pythonrepack):
|
||||
# In the case of a loose-only repack, fallback to Python, as Rust doesn't support them.
|
||||
if options.get(constants.OPTION_LOOSEONLY):
|
||||
@ -157,12 +153,9 @@ def _shareddatastoresrepack(repo, options, incremental):
|
||||
limit = repo.ui.configbytes("remotefilelog", "cachelimit", "10GB")
|
||||
_cleanuppacks(repo.ui, packpath, limit)
|
||||
|
||||
if _userustrepack(repo):
|
||||
_runrustrepack(
|
||||
repo, options, packpath, incremental, _shareddatastorespythonrepack
|
||||
)
|
||||
else:
|
||||
_shareddatastorespythonrepack(repo, options, packpath, incremental)
|
||||
_runrustrepack(
|
||||
repo, options, packpath, incremental, _shareddatastorespythonrepack
|
||||
)
|
||||
|
||||
|
||||
def _localdatapythonrepack(repo, options, packpath, incremental):
|
||||
@ -201,10 +194,7 @@ def _localdatarepack(repo, options, incremental):
|
||||
)
|
||||
_cleanuppacks(repo.ui, packpath, 0)
|
||||
|
||||
if _userustrepack(repo):
|
||||
_runrustrepack(repo, options, packpath, incremental, _localdatapythonrepack)
|
||||
else:
|
||||
_localdatapythonrepack(repo, options, packpath, incremental)
|
||||
_runrustrepack(repo, options, packpath, incremental, _localdatapythonrepack)
|
||||
|
||||
|
||||
def _manifestpythonrepack(
|
||||
@ -250,20 +240,15 @@ def _manifestrepack(repo, options, incremental):
|
||||
else 0
|
||||
)
|
||||
_cleanuppacks(repo.ui, packpath, limit)
|
||||
if _userustrepack(repo):
|
||||
_runrustrepack(
|
||||
repo,
|
||||
options,
|
||||
packpath,
|
||||
incremental,
|
||||
lambda repo, options, packpath, incremental: _manifestpythonrepack(
|
||||
repo, options, packpath, dstores, hstores, incremental, shared
|
||||
),
|
||||
)
|
||||
else:
|
||||
_manifestpythonrepack(
|
||||
_runrustrepack(
|
||||
repo,
|
||||
options,
|
||||
packpath,
|
||||
incremental,
|
||||
lambda repo, options, packpath, incremental: _manifestpythonrepack(
|
||||
repo, options, packpath, dstores, hstores, incremental, shared
|
||||
)
|
||||
),
|
||||
)
|
||||
|
||||
# Repack the shared manifest store
|
||||
_domanifestrepack(spackpath, sdstores, shstores, True)
|
||||
|
@ -26,7 +26,7 @@
|
||||
# Set the prefetchdays config to zero so that all commits are prefetched
|
||||
# no matter what their creation date is.
|
||||
$ cd shallow
|
||||
$ setconfig remotefilelog.prefetchdays=0 remotefilelog.userustrepack=True
|
||||
$ setconfig remotefilelog.prefetchdays=0
|
||||
$ cd ..
|
||||
|
||||
# Test that repack cleans up the old files and creates new packs
|
||||
|
@ -24,7 +24,6 @@
|
||||
$ cat >> .hg/hgrc <<EOF
|
||||
> [remotefilelog]
|
||||
> prefetchdays=0
|
||||
> userustrepack=True
|
||||
> fetchpacks=True
|
||||
> EOF
|
||||
$ cd ..
|
||||
|
@ -23,10 +23,6 @@
|
||||
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
|
||||
|
||||
$ cd shallow
|
||||
$ cat >> .hg/hgrc <<EOF
|
||||
> [remotefilelog]
|
||||
> userustrepack=True
|
||||
> EOF
|
||||
$ cd ..
|
||||
|
||||
$ cd shallow
|
||||
|
@ -24,7 +24,6 @@
|
||||
$ cat >> .hg/hgrc <<EOF
|
||||
> [remotefilelog]
|
||||
> prefetchdays=0
|
||||
> userustrepack=True
|
||||
> fetchpacks=True
|
||||
> EOF
|
||||
$ cd ..
|
||||
|
Loading…
Reference in New Issue
Block a user