mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
lfs: remove setup.py
Summary: The logic in `setup.py` is now simple enough to be moved to `reposetup`. `setup.py` becomes unused and gets removed. Test Plan: `rt test-lfs.t` Reviewers: #mercurial, simonfar Reviewed By: simonfar Subscribers: mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4813193 Signature: t1:4813193:1491212154:0238ea448269b0e5516c927c1fa989d6d9130d4a
This commit is contained in:
parent
f0b6b81970
commit
b1cdf3f0e6
@ -35,7 +35,7 @@ from mercurial import (
|
||||
)
|
||||
|
||||
from . import (
|
||||
setup,
|
||||
blobstore,
|
||||
wrapper,
|
||||
)
|
||||
|
||||
@ -48,10 +48,13 @@ def reposetup(ui, repo):
|
||||
# Do not setup blobstores if bypass is True
|
||||
return
|
||||
|
||||
setup.threshold(ui, repo)
|
||||
setup.localblobstore(ui, repo)
|
||||
setup.chunking(ui, repo)
|
||||
setup.remoteblobstore(ui, repo)
|
||||
threshold = repo.ui.configbytes('lfs', 'threshold', None)
|
||||
chunksize = repo.ui.configbytes('lfs', 'chunksize', None)
|
||||
|
||||
repo.svfs.options['lfsthreshold'] = threshold
|
||||
repo.svfs.options['lfschunksize'] = chunksize
|
||||
repo.svfs.lfslocalblobstore = blobstore.local(repo)
|
||||
repo.svfs.lfsremoteblobstore = blobstore.remote(repo)
|
||||
|
||||
# Push hook
|
||||
repo.prepushoutgoinghooks.add('lfs', wrapper.prepush)
|
||||
|
@ -1,25 +0,0 @@
|
||||
# coding=UTF-8
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
from . import (
|
||||
blobstore,
|
||||
)
|
||||
|
||||
def threshold(ui, repo):
|
||||
"""Configure threshold for a file to be handled by LFS"""
|
||||
threshold = ui.configbytes('lfs', 'threshold', None)
|
||||
repo.svfs.options['lfsthreshold'] = threshold
|
||||
|
||||
def localblobstore(ui, repo):
|
||||
"""Configure local blobstore"""
|
||||
repo.svfs.lfslocalblobstore = blobstore.local(repo)
|
||||
|
||||
def chunking(ui, repo):
|
||||
"""Configure chunking for massive blobs to be split into smaller chunks."""
|
||||
chunksize = ui.configbytes('lfs', 'chunksize', None)
|
||||
repo.svfs.options['lfschunksize'] = chunksize
|
||||
|
||||
def remoteblobstore(ui, repo):
|
||||
"""Configure remote blobstore."""
|
||||
repo.svfs.lfsremoteblobstore = blobstore.remote(repo)
|
Loading…
Reference in New Issue
Block a user