mirror of
https://github.com/facebook/sapling.git
synced 2024-10-05 14:28:17 +03:00
scmstore: kill "enableshim" flag
Summary: Kill scmstore.enableshim flag, always using scmstore over content store. Reviewed By: sggutier Differential Revision: D45556672 fbshipit-source-id: 159eb2bfa14a9870ac0a3931f18f654c638bcc3f
This commit is contained in:
parent
a73edbc8b6
commit
aba56cfd2e
@ -6,9 +6,6 @@
|
||||
|
||||
$ CACHEDIR=$PWD/cachepath
|
||||
$ . "${TEST_FIXTURES}/library.sh"
|
||||
# scmstore shim disabled due to test's reliance on pack files
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False scmstore.enableshim=False
|
||||
|
||||
|
||||
Setup repo config (we use blob_files to share across Mononoke and API Server):
|
||||
$ LFS_THRESHOLD="1000" setup_common_config "blob_files"
|
||||
@ -187,11 +184,17 @@ Change "sha256:oid" to an another valid oid to check sha1 consisnency
|
||||
$ echo "${LONG}inconsistent" > inconsistent_file
|
||||
$ hg commit -Aqm "hash check"
|
||||
|
||||
$ PACK_TO_CORRUPT=".hg/store/packs/53030272778e08be8e520a61c0848183520e58ba.datapack"
|
||||
$ chmod 666 "$PACK_TO_CORRUPT"
|
||||
$ sed -i s/sha256:f79cf994214182953d15cd20b2a92731052ddc9a02f4c60518dc78d7a005cca9/sha256:e2fff2ce58d585b4b0572e0a323f9e7e5f98cc641489e12c03c401d05d0e350d/ "$PACK_TO_CORRUPT"
|
||||
Corrupt file contents via an extension:
|
||||
$ cat > $TESTTMP/corrupt.py <<EOF
|
||||
> def _revision(orig, rfl, node, raw=False):
|
||||
> return orig(rfl, node, raw).replace(b"sha256:f79cf994214182953d15cd20b2a92731052ddc9a02f4c60518dc78d7a005cca9", b"sha256:e2fff2ce58d585b4b0572e0a323f9e7e5f98cc641489e12c03c401d05d0e350d")
|
||||
> from edenscm import extensions
|
||||
> from edenscm.ext import remotefilelog
|
||||
> def uisetup(ui):
|
||||
> extensions.wrapfunction(remotefilelog.remotefilelog.remotefilelog, "revision", _revision)
|
||||
> EOF
|
||||
|
||||
$ hgmn push -r . --to master_bookmark -v
|
||||
$ hgmn push -r . --to master_bookmark -v --config extensions.corrupt=$TESTTMP/corrupt.py
|
||||
pushing rev 77f499cb0645 to destination mononoke://$LOCALIP:$LOCAL_PORT/repo bookmark master_bookmark
|
||||
searching for changes
|
||||
validated revset for rebase
|
||||
|
@ -6,10 +6,6 @@
|
||||
|
||||
$ CACHEDIR=$PWD/cachepath
|
||||
$ . "${TEST_FIXTURES}/library.sh"
|
||||
# Disable scmstore because this tests specifically legacy LFS
|
||||
# TODO(meyer): Not removing because I think we should be able to make this work as it does with
|
||||
# remotefilelog only.
|
||||
$ setconfig scmstore.enableshim=False
|
||||
|
||||
# Setup a repository config, with LFS enabled
|
||||
$ LFS_THRESHOLD=1000 setup_common_config
|
||||
|
@ -50,18 +50,20 @@
|
||||
$ echo "hello_world" > file
|
||||
$ hg commit -Aqm "commit"
|
||||
|
||||
# remotefilelog is True, so reference to filenodes are by hashes (SHA1)
|
||||
$ PACK_TO_CORRUPT=".hg/store/packs/dee3d9750ad87ede865d69e20330c34e51ec83d5.datapack"
|
||||
# change access to file, as it is readonly
|
||||
$ chmod 666 "$PACK_TO_CORRUPT"
|
||||
$ sed -i s/hello_world/aaaaaaaaaaa/ "$PACK_TO_CORRUPT"
|
||||
# TODO(meyer): Corrupt indexedlog instead and disable integrity checks
|
||||
# $ chmod 666 .hg/store/indexedlogdatastore/log
|
||||
# $ sed -i s/hello_world/aaaaaaaaaaa/ .hg/store/indexedlogdatastore/log
|
||||
Corrupt file contents via an extension:
|
||||
$ cat > $TESTTMP/corrupt.py <<EOF
|
||||
> def _revision(orig, rfl, node, raw=False):
|
||||
> return orig(rfl, node, raw).replace(b"hello_world", b"aaaaaaaaaaa")
|
||||
> from edenscm import extensions
|
||||
> from edenscm.ext import remotefilelog
|
||||
> def uisetup(ui):
|
||||
> extensions.wrapfunction(remotefilelog.remotefilelog.remotefilelog, "revision", _revision)
|
||||
> EOF
|
||||
|
||||
|
||||
Do a push, but disable cache verification on the client side, otherwise
|
||||
filenode won't be send at all
|
||||
$ hgmn push -r . --to master_bookmark -v --config remotefilelog.validatecachehashes=False
|
||||
$ hgmn push -r . --to master_bookmark -v --config remotefilelog.validatecachehashes=False --config extensions.corrupt=$TESTTMP/corrupt.py
|
||||
pushing rev cb67355f2348 to destination mononoke://$LOCALIP:$LOCAL_PORT/repo bookmark master_bookmark
|
||||
searching for changes
|
||||
validated revset for rebase
|
||||
|
@ -580,24 +580,14 @@ class remotefileslog(filelog.fileslog):
|
||||
|
||||
mask = os.umask(0o002)
|
||||
try:
|
||||
if repo.ui.configbool("scmstore", "enableshim"):
|
||||
sharedonlycontentstore = revisionstore.filescmstore(
|
||||
None,
|
||||
repo.ui._rcfg,
|
||||
sharedonlyremotestore,
|
||||
memcachestore,
|
||||
edenapistore,
|
||||
correlator=correlator,
|
||||
)
|
||||
else:
|
||||
sharedonlycontentstore = revisionstore.contentstore(
|
||||
None,
|
||||
repo.ui._rcfg,
|
||||
sharedonlyremotestore,
|
||||
memcachestore,
|
||||
edenapistore,
|
||||
correlator=correlator,
|
||||
)
|
||||
sharedonlycontentstore = revisionstore.filescmstore(
|
||||
None,
|
||||
repo.ui._rcfg,
|
||||
sharedonlyremotestore,
|
||||
memcachestore,
|
||||
edenapistore,
|
||||
correlator=correlator,
|
||||
)
|
||||
sharedonlymetadatastore = revisionstore.metadatastore(
|
||||
None,
|
||||
repo.ui._rcfg,
|
||||
@ -628,10 +618,7 @@ class remotefileslog(filelog.fileslog):
|
||||
edenapistore,
|
||||
correlator=correlator,
|
||||
)
|
||||
if repo.ui.configbool("scmstore", "enableshim"):
|
||||
self.contentstore = self.filescmstore
|
||||
else:
|
||||
self.contentstore = self.filescmstore.get_contentstore()
|
||||
self.contentstore = self.filescmstore
|
||||
self.metadatastore = revisionstore.metadatastore(
|
||||
repo.svfs.vfs.base,
|
||||
repo.ui._rcfg,
|
||||
|
@ -601,10 +601,7 @@ class basetreemanifestlog(object):
|
||||
"manifests",
|
||||
correlator=correlator,
|
||||
)
|
||||
if self._repo.ui.configbool("scmstore", "enableshim"):
|
||||
self.datastore = self.treescmstore
|
||||
else:
|
||||
self.datastore = self.treescmstore.get_contentstore()
|
||||
self.datastore = self.treescmstore
|
||||
self.historystore = revisionstore.metadatastore(
|
||||
self._repo.svfs.vfs.base,
|
||||
self.ui._rcfg,
|
||||
|
@ -606,7 +606,6 @@ httpcommitlookup=True
|
||||
|
||||
[scmstore]
|
||||
backingstore=True
|
||||
enableshim=True
|
||||
contentstorefallback=False
|
||||
lfsptrwrites=True
|
||||
auxindexedlog=True
|
||||
|
@ -3,9 +3,7 @@ Default config file for testing
|
||||
"""
|
||||
|
||||
|
||||
def get_content(
|
||||
use_watchman: bool = False, use_ipv6: bool = False, is_run_tests_py: bool = False
|
||||
) -> str:
|
||||
def get_content(use_watchman: bool = False, use_ipv6: bool = False) -> str:
|
||||
content = f"""
|
||||
[ui]
|
||||
slash=True
|
||||
@ -55,6 +53,9 @@ record=False
|
||||
|
||||
[hint]
|
||||
ack-match-full-traversal=True
|
||||
|
||||
[scmstore]
|
||||
contentstorefallback=True
|
||||
"""
|
||||
if use_watchman:
|
||||
content += """
|
||||
@ -63,15 +64,6 @@ fsmonitor=
|
||||
|
||||
[fsmonitor]
|
||||
detectrace=True
|
||||
"""
|
||||
|
||||
# Extra configs for run-tests.py.
|
||||
# For compatibility. Ideally this does not exist.
|
||||
if is_run_tests_py:
|
||||
content += """
|
||||
[scmstore]
|
||||
enableshim=True
|
||||
contentstorefallback=True
|
||||
"""
|
||||
|
||||
return content
|
||||
|
@ -1584,7 +1584,6 @@ class Test(unittest.TestCase):
|
||||
content = default_hgrc.get_content(
|
||||
use_watchman=self._watchman,
|
||||
use_ipv6=self._useipv6,
|
||||
is_run_tests_py=True,
|
||||
)
|
||||
with open(path, "w") as hgrc:
|
||||
hgrc.write(content)
|
||||
|
@ -16,6 +16,7 @@ Create a repository:
|
||||
remotefilelog.cachepath=$TESTTMP/default-hgcache
|
||||
remotefilelog.localdatarepack=True
|
||||
remotefilelog.reponame=reponame-default
|
||||
scmstore.contentstorefallback=True
|
||||
status.use-rust=True
|
||||
treemanifest.rustmanifest=True
|
||||
treemanifest.sendtrees=True
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
$ . "$TESTDIR/library.sh"
|
||||
$ setconfig devel.print-metrics=1 devel.skip-metrics=scmstore,watchman
|
||||
$ setconfig scmstore.enableshim=True scmstore.contentstorefallback=True
|
||||
|
||||
$ hginit master
|
||||
$ cd master
|
||||
|
@ -3,7 +3,6 @@
|
||||
$ setconfig experimental.allowfilepeer=True
|
||||
$ setconfig devel.print-metrics=1 devel.skip-metrics=watchman
|
||||
$ setconfig treemanifest.treeonly=False
|
||||
$ setconfig scmstore.enableshim=True scmstore.contentstorefallback=True
|
||||
|
||||
$ hginit master
|
||||
$ cd master
|
||||
|
@ -20,10 +20,6 @@ Init:
|
||||
|
||||
$ enable lfs remotefilelog
|
||||
$ setconfig lfs.url=file://$TESTTMP/remote remotefilelog.cachepath=$TESTTMP/cache
|
||||
# Disable scmstore because this tests specifically legacy LFS
|
||||
# TODO(meyer): Not removing because I think we should be able to make this work as it does with
|
||||
# remotefilelog only.
|
||||
$ setconfig scmstore.enableshim=False
|
||||
|
||||
Helper functions to create commits:
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
$ setconfig experimental.allowfilepeer=True
|
||||
|
||||
$ enable lfs remotefilelog
|
||||
$ setconfig lfs.url=file://$TESTTMP/cache lfs.threshold=1 remotefilelog.cachepath=$TESTTMP/rflcache scmstore.enableshim=False
|
||||
$ setconfig lfs.url=file://$TESTTMP/cache lfs.threshold=1 remotefilelog.cachepath=$TESTTMP/rflcache
|
||||
|
||||
Write a LFS file to the repo
|
||||
|
||||
|
@ -44,7 +44,6 @@
|
||||
$ clone master shallow --noupdate
|
||||
$ cd shallow
|
||||
|
||||
$ setconfig scmstore.contentstorefallback=True
|
||||
$ hg goto -q master --config remotefilelog.undesiredfileregex=".*" 2>&1 | sort
|
||||
1 trees fetched over 0.00s
|
||||
1 trees fetched over 0.00s
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
$ newserver server
|
||||
$ newremoterepo
|
||||
$ setconfig scmstore.enableshim=True
|
||||
|
||||
$ echo c > f
|
||||
$ hg ci -A -m 0 -q
|
||||
|
Loading…
Reference in New Issue
Block a user