mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 06:47:41 +03:00
indexedlog: make writing to indexedlog the default
Summary: We've rolled both of these out to 100%. Let's make this the default so we can delete those configs. Reviewed By: quark-zju Differential Revision: D26233645 fbshipit-source-id: cd7a08c404483f78ab714763870f5bf0fa801e7a
This commit is contained in:
parent
ca1249c269
commit
9c1b611dff
@ -5,6 +5,7 @@
|
||||
# directory of this source tree.
|
||||
|
||||
$ . "${TEST_FIXTURES}/library.sh"
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
setup configuration
|
||||
$ setup_common_config
|
||||
|
@ -5,6 +5,7 @@
|
||||
# directory of this source tree.
|
||||
|
||||
$ . "${TEST_FIXTURES}/library.sh"
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
setup configuration
|
||||
$ setup_common_config
|
||||
|
@ -5,6 +5,7 @@
|
||||
# directory of this source tree.
|
||||
|
||||
$ . "${TEST_FIXTURES}/library.sh"
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
setup configuration
|
||||
$ setup_common_config
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
$ CACHEDIR=$PWD/cachepath
|
||||
$ . "${TEST_FIXTURES}/library.sh"
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
# setup config repo
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
$ CACHEDIR=$PWD/cachepath
|
||||
$ . "${TEST_FIXTURES}/library.sh"
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
Setup repo config (we use blob_files to share across Mononoke and API Server):
|
||||
$ LFS_THRESHOLD="1000" setup_common_config "blob_files"
|
||||
|
@ -5,6 +5,7 @@
|
||||
# directory of this source tree.
|
||||
|
||||
$ . "${TEST_FIXTURES}/library.sh"
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
define an extension that reveals when Mercurial is fixing up linkrevs
|
||||
|
||||
|
@ -372,19 +372,20 @@ impl<'a> ContentStoreBuilder<'a> {
|
||||
let shared_lfs_store = Arc::new(LfsStore::shared(&cache_path, self.config)?);
|
||||
blob_stores.add(shared_lfs_store.clone());
|
||||
|
||||
let primary: Arc<dyn HgIdMutableDeltaStore> = if self
|
||||
.config
|
||||
.get_or_default::<bool>("remotefilelog", "write-hgcache-to-indexedlog")?
|
||||
{
|
||||
// Put the indexedlog first, since recent data will have gone there.
|
||||
datastore.add(shared_indexedlogdatastore.clone());
|
||||
datastore.add(shared_pack_store.clone());
|
||||
shared_indexedlogdatastore
|
||||
} else {
|
||||
datastore.add(shared_pack_store.clone());
|
||||
datastore.add(shared_indexedlogdatastore.clone());
|
||||
shared_pack_store
|
||||
};
|
||||
let primary: Arc<dyn HgIdMutableDeltaStore> =
|
||||
if self
|
||||
.config
|
||||
.get_or("remotefilelog", "write-hgcache-to-indexedlog", || true)?
|
||||
{
|
||||
// Put the indexedlog first, since recent data will have gone there.
|
||||
datastore.add(shared_indexedlogdatastore.clone());
|
||||
datastore.add(shared_pack_store);
|
||||
shared_indexedlogdatastore
|
||||
} else {
|
||||
datastore.add(shared_pack_store.clone());
|
||||
datastore.add(shared_indexedlogdatastore);
|
||||
shared_pack_store
|
||||
};
|
||||
datastore.add(shared_lfs_store.clone());
|
||||
|
||||
let shared_mutabledatastore: Arc<dyn HgIdMutableDeltaStore> = {
|
||||
@ -416,19 +417,20 @@ impl<'a> ContentStoreBuilder<'a> {
|
||||
IndexedLogDataStoreType::Local,
|
||||
)?);
|
||||
|
||||
let primary: Arc<dyn HgIdMutableDeltaStore> = if self
|
||||
.config
|
||||
.get_or_default::<bool>("remotefilelog", "write-local-to-indexedlog")?
|
||||
{
|
||||
// Put the indexedlog first, since recent data will have gone there.
|
||||
datastore.add(local_indexedlogdatastore.clone());
|
||||
datastore.add(local_pack_store);
|
||||
local_indexedlogdatastore
|
||||
} else {
|
||||
datastore.add(local_pack_store.clone());
|
||||
datastore.add(local_indexedlogdatastore);
|
||||
local_pack_store
|
||||
};
|
||||
let primary: Arc<dyn HgIdMutableDeltaStore> =
|
||||
if self
|
||||
.config
|
||||
.get_or("remotefilelog", "write-local-to-indexedlog", || true)?
|
||||
{
|
||||
// Put the indexedlog first, since recent data will have gone there.
|
||||
datastore.add(local_indexedlogdatastore.clone());
|
||||
datastore.add(local_pack_store);
|
||||
local_indexedlogdatastore
|
||||
} else {
|
||||
datastore.add(local_pack_store.clone());
|
||||
datastore.add(local_indexedlogdatastore);
|
||||
local_pack_store
|
||||
};
|
||||
|
||||
let local_lfs_store = Arc::new(LfsStore::local(&local_path.unwrap(), self.config)?);
|
||||
blob_stores.add(local_lfs_store.clone());
|
||||
@ -631,7 +633,13 @@ mod tests {
|
||||
fn test_add_dropped() -> Result<()> {
|
||||
let cachedir = TempDir::new()?;
|
||||
let localdir = TempDir::new()?;
|
||||
let config = make_config(&cachedir);
|
||||
let mut config = make_config(&cachedir);
|
||||
config.set(
|
||||
"remotefilelog",
|
||||
"write-local-to-indexedlog",
|
||||
Some("False"),
|
||||
&Default::default(),
|
||||
);
|
||||
|
||||
let store = ContentStore::new(&localdir, &config)?;
|
||||
|
||||
@ -845,7 +853,13 @@ mod tests {
|
||||
fn test_add_shared_only_store() -> Result<()> {
|
||||
let cachedir = TempDir::new()?;
|
||||
let localdir = TempDir::new()?;
|
||||
let config = make_config(&cachedir);
|
||||
let mut config = make_config(&cachedir);
|
||||
config.set(
|
||||
"remotefilelog",
|
||||
"write-local-to-indexedlog",
|
||||
Some("False"),
|
||||
&Default::default(),
|
||||
);
|
||||
|
||||
let store = ContentStore::new(&localdir, &config)?;
|
||||
|
||||
@ -1038,6 +1052,18 @@ mod tests {
|
||||
let cachedir = TempDir::new()?;
|
||||
let localdir = TempDir::new()?;
|
||||
let mut config = make_config(&cachedir);
|
||||
config.set(
|
||||
"remotefilelog",
|
||||
"write-local-to-indexedlog",
|
||||
Some("False"),
|
||||
&Default::default(),
|
||||
);
|
||||
config.set(
|
||||
"remotefilelog",
|
||||
"write-hgcache-to-indexedlog",
|
||||
Some("False"),
|
||||
&Default::default(),
|
||||
);
|
||||
|
||||
let k = key("a", "2");
|
||||
let store_key = StoreKey::hgid(k.clone());
|
||||
|
@ -258,19 +258,20 @@ impl<'a> MetadataStoreBuilder<'a> {
|
||||
// - When pushing changes on a pushrebase server, the local linknode will become
|
||||
// incorrect, future fetches will put that change in the shared cache where the linknode
|
||||
// will be correct.
|
||||
let primary: Arc<dyn HgIdMutableHistoryStore> = if self
|
||||
.config
|
||||
.get_or_default::<bool>("remotefilelog", "write-hgcache-to-indexedlog")?
|
||||
{
|
||||
// Put the indexedlog first, since recent data will have gone there.
|
||||
historystore.add(shared_indexedloghistorystore.clone());
|
||||
historystore.add(shared_pack_store.clone());
|
||||
shared_indexedloghistorystore
|
||||
} else {
|
||||
historystore.add(shared_pack_store.clone());
|
||||
historystore.add(shared_indexedloghistorystore.clone());
|
||||
shared_pack_store
|
||||
};
|
||||
let primary: Arc<dyn HgIdMutableHistoryStore> =
|
||||
if self
|
||||
.config
|
||||
.get_or("remotefilelog", "write-hgcache-to-indexedlog", || true)?
|
||||
{
|
||||
// Put the indexedlog first, since recent data will have gone there.
|
||||
historystore.add(shared_indexedloghistorystore.clone());
|
||||
historystore.add(shared_pack_store);
|
||||
shared_indexedloghistorystore
|
||||
} else {
|
||||
historystore.add(shared_pack_store.clone());
|
||||
historystore.add(shared_indexedloghistorystore);
|
||||
shared_pack_store
|
||||
};
|
||||
|
||||
let local_mutablehistorystore: Option<Arc<dyn HgIdMutableHistoryStore>> =
|
||||
if let Some(unsuffixed_local_path) = self.local_path {
|
||||
@ -285,19 +286,20 @@ impl<'a> MetadataStoreBuilder<'a> {
|
||||
&self.config,
|
||||
IndexedLogHistoryStoreType::Local,
|
||||
)?);
|
||||
let primary: Arc<dyn HgIdMutableHistoryStore> = if self
|
||||
.config
|
||||
.get_or_default::<bool>("remotefilelog", "write-local-to-indexedlog")?
|
||||
{
|
||||
// Put the indexedlog first, since recent data will have gone there.
|
||||
historystore.add(local_indexedloghistorystore.clone());
|
||||
historystore.add(local_pack_store);
|
||||
local_indexedloghistorystore
|
||||
} else {
|
||||
historystore.add(local_pack_store.clone());
|
||||
historystore.add(local_indexedloghistorystore);
|
||||
local_pack_store
|
||||
};
|
||||
let primary: Arc<dyn HgIdMutableHistoryStore> =
|
||||
if self
|
||||
.config
|
||||
.get_or("remotefilelog", "write-local-to-indexedlog", || true)?
|
||||
{
|
||||
// Put the indexedlog first, since recent data will have gone there.
|
||||
historystore.add(local_indexedloghistorystore.clone());
|
||||
historystore.add(local_pack_store);
|
||||
local_indexedloghistorystore
|
||||
} else {
|
||||
historystore.add(local_pack_store.clone());
|
||||
historystore.add(local_indexedloghistorystore);
|
||||
local_pack_store
|
||||
};
|
||||
|
||||
Some(primary)
|
||||
} else {
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
$ disable treemanifest
|
||||
$ setconfig remotenames.selectivepull=1
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
$ . "$TESTDIR/library.sh"
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
$ disable treemanifest
|
||||
$ setconfig remotenames.selectivepull=1
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
$ LFSPATH=$TESTTMP/lfs
|
||||
$ export LFSPATH
|
||||
|
@ -3,6 +3,7 @@
|
||||
$ disable treemanifest
|
||||
$ enable remotenames
|
||||
$ setconfig remotenames.selectivepull=1
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
$ . "$TESTDIR/library.sh"
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#chg-compatible
|
||||
|
||||
$ disable treemanifest
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
# Tests for the complicated linknode logic in remotefilelog.py::ancestormap()
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#chg-compatible
|
||||
|
||||
$ disable treemanifest
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
$ shorttraceback
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
$ disable treemanifest
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
#testcases vfscachestore simplecachestore
|
||||
|
||||
$ . "$TESTDIR/library.sh"
|
||||
|
@ -1,6 +1,7 @@
|
||||
#chg-compatible
|
||||
|
||||
$ disable treemanifest
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
$ . "$TESTDIR/library.sh"
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#chg-compatible
|
||||
|
||||
$ disable treemanifest
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
$ . "$TESTDIR/library.sh"
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#chg-compatible
|
||||
|
||||
$ disable treemanifest
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
$ . "$TESTDIR/library.sh"
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
$ disable treemanifest
|
||||
$ . "$TESTDIR/library.sh"
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
$ cat >> $HGRCPATH <<EOF
|
||||
> [remotefilelog]
|
||||
|
@ -1,6 +1,7 @@
|
||||
#chg-compatible
|
||||
|
||||
$ . "$TESTDIR/library.sh"
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
$ hginit master
|
||||
$ cd master
|
||||
|
@ -1,6 +1,7 @@
|
||||
#chg-compatible
|
||||
|
||||
$ disable treemanifest
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
$ . "$TESTDIR/library.sh"
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#chg-compatible
|
||||
|
||||
$ . "$TESTDIR/library.sh"
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
$ newserver master
|
||||
$ clone master shallow
|
||||
|
@ -1,5 +1,7 @@
|
||||
#chg-compatible
|
||||
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
$ newserver master
|
||||
$ setconfig extensions.lfs= lfs.url=file:$TESTTMP/lfs-server
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#chg-compatible
|
||||
|
||||
$ configure modern
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
$ newserver master
|
||||
$ setconfig extensions.lfs= lfs.url=file:$TESTTMP/lfs-server
|
||||
|
@ -1,6 +1,7 @@
|
||||
#chg-compatible
|
||||
|
||||
$ . "$TESTDIR/library.sh"
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
$ newserver master
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#chg-compatible
|
||||
|
||||
$ . "$TESTDIR/library.sh"
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
$ newserver master
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
$ . "$TESTDIR/library.sh"
|
||||
$ setconfig devel.print-metrics=1
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
|
||||
$ hginit master
|
||||
|
@ -1,6 +1,7 @@
|
||||
#chg-compatible
|
||||
|
||||
$ . "$TESTDIR/library.sh"
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
$ cat >> $HGRCPATH <<EOF
|
||||
> [treemanifest]
|
||||
|
@ -3,6 +3,7 @@
|
||||
$ . "$TESTDIR/library.sh"
|
||||
$ . "$TESTDIR/infinitepush/library.sh"
|
||||
$ setconfig treemanifest.flatcompat=False
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
$ setupcommon
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#chg-compatible
|
||||
|
||||
$ CACHEDIR=`pwd`/hgcache
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
$ . "$TESTDIR/library.sh"
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
$ CACHEDIR=`pwd`/hgcache
|
||||
|
||||
$ . "$TESTDIR/library.sh"
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
$ enable remotenames
|
||||
$ hginit master
|
||||
|
@ -4,6 +4,7 @@ Push treeonly commits from a treeonly shallow repo to a treeonly server
|
||||
|
||||
$ setconfig remotefilelog.reponame=x remotefilelog.cachepath=$TESTTMP/cache
|
||||
$ setconfig treemanifest.flatcompat=False
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
$ configure dummyssh
|
||||
|
||||
$ newrepo server
|
||||
|
@ -1,6 +1,7 @@
|
||||
#chg-compatible
|
||||
|
||||
$ enable amend
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
$ . "$TESTDIR/library.sh"
|
||||
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#chg-compatible
|
||||
|
||||
$ . "$TESTDIR/library.sh"
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
$ cat >> $HGRCPATH <<EOF
|
||||
> [extensions]
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#testcases vfscachestore simplecachestore
|
||||
$ setconfig treemanifest.flatcompat=False
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
$ configure mutation-norecord
|
||||
$ . "$TESTDIR/library.sh"
|
||||
|
@ -1,6 +1,7 @@
|
||||
#chg-compatible
|
||||
|
||||
$ setconfig treemanifest.flatcompat=False remotefilelog.localdatarepack=True
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
$ . "$TESTDIR/library.sh"
|
||||
|
||||
Setup the server
|
||||
|
@ -1,6 +1,7 @@
|
||||
#chg-compatible
|
||||
|
||||
$ . "$TESTDIR/library.sh"
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
|
||||
|
||||
$ hginit master
|
||||
|
@ -5,6 +5,7 @@ Crash in histpack code path where the amend destination already exists
|
||||
$ configure mutation-norecord
|
||||
$ enable undo treemanifest remotefilelog
|
||||
$ setconfig treemanifest.treeonly=1 remotefilelog.reponame=foo remotefilelog.cachepath=$TESTTMP/cache
|
||||
$ setconfig remotefilelog.write-hgcache-to-indexedlog=False remotefilelog.write-local-to-indexedlog=False
|
||||
$ newrepo
|
||||
$ drawdag << 'EOS'
|
||||
> B
|
||||
|
Loading…
Reference in New Issue
Block a user