mirror of
https://github.com/facebook/sapling.git
synced 2024-10-04 22:07:44 +03:00
rename ClientConfig to CheckoutConfig
Summary: Rename the `ClientConfig` class to `CheckoutConfig`, to help further progress on updating our terminology from "client" to "checkout". Reviewed By: chadaustin Differential Revision: D15162814 fbshipit-source-id: 3575958f1161d5842c6f0ee9e2d2d20ab20b7372
This commit is contained in:
parent
51641fffc5
commit
53496dcdd3
@ -155,7 +155,7 @@ class EdenInstance:
|
||||
${HOME} will be replaced by the user's home dir,
|
||||
${USER} will be replaced by the user's login name.
|
||||
These are coupled with the equivalent code in
|
||||
eden/fs/config/ClientConfig.cpp and must be kept in sync.
|
||||
eden/fs/config/CheckoutConfig.cpp and must be kept in sync.
|
||||
"""
|
||||
parser = configutil.EdenConfigParser(
|
||||
interpolation=configinterpolator.EdenConfigInterpolator(
|
||||
|
@ -7,7 +7,8 @@
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
*/
|
||||
#include "ClientConfig.h"
|
||||
#include "eden/fs/config/CheckoutConfig.h"
|
||||
|
||||
#include <cpptoml.h> // @manual=fbsource//third-party/cpptoml:cpptoml
|
||||
|
||||
#include <folly/Range.h>
|
||||
@ -31,7 +32,7 @@ using std::string;
|
||||
|
||||
namespace {
|
||||
// TOML config file for the individual client.
|
||||
const facebook::eden::RelativePathPiece kClientConfig{"config.toml"};
|
||||
const facebook::eden::RelativePathPiece kCheckoutConfig{"config.toml"};
|
||||
|
||||
// Keys for the TOML config file.
|
||||
constexpr folly::StringPiece kBindMountsSection{"bind-mounts"};
|
||||
@ -64,12 +65,12 @@ enum : uint32_t {
|
||||
namespace facebook {
|
||||
namespace eden {
|
||||
|
||||
ClientConfig::ClientConfig(
|
||||
CheckoutConfig::CheckoutConfig(
|
||||
AbsolutePathPiece mountPath,
|
||||
AbsolutePathPiece clientDirectory)
|
||||
: clientDirectory_(clientDirectory), mountPath_(mountPath) {}
|
||||
|
||||
ParentCommits ClientConfig::getParentCommits() const {
|
||||
ParentCommits CheckoutConfig::getParentCommits() const {
|
||||
// Read the snapshot.
|
||||
auto snapshotFile = getSnapshotPath();
|
||||
string snapshotFileContents;
|
||||
@ -129,7 +130,7 @@ ParentCommits ClientConfig::getParentCommits() const {
|
||||
return parents;
|
||||
}
|
||||
|
||||
void ClientConfig::setParentCommits(const ParentCommits& parents) const {
|
||||
void CheckoutConfig::setParentCommits(const ParentCommits& parents) const {
|
||||
std::array<uint8_t, kSnapshotHeaderSize + (2 * Hash::RAW_SIZE)> buffer;
|
||||
IOBuf buf(IOBuf::WRAP_BUFFER, ByteRange{buffer});
|
||||
folly::io::RWPrivateCursor cursor{&buf};
|
||||
@ -155,32 +156,32 @@ void ClientConfig::setParentCommits(const ParentCommits& parents) const {
|
||||
#endif
|
||||
}
|
||||
|
||||
void ClientConfig::setParentCommits(Hash parent1, std::optional<Hash> parent2)
|
||||
void CheckoutConfig::setParentCommits(Hash parent1, std::optional<Hash> parent2)
|
||||
const {
|
||||
return setParentCommits(ParentCommits{parent1, parent2});
|
||||
}
|
||||
|
||||
const AbsolutePath& ClientConfig::getClientDirectory() const {
|
||||
const AbsolutePath& CheckoutConfig::getClientDirectory() const {
|
||||
return clientDirectory_;
|
||||
}
|
||||
|
||||
AbsolutePath ClientConfig::getSnapshotPath() const {
|
||||
AbsolutePath CheckoutConfig::getSnapshotPath() const {
|
||||
return clientDirectory_ + kSnapshotFile;
|
||||
}
|
||||
|
||||
AbsolutePath ClientConfig::getOverlayPath() const {
|
||||
AbsolutePath CheckoutConfig::getOverlayPath() const {
|
||||
return clientDirectory_ + kOverlayDir;
|
||||
}
|
||||
|
||||
std::unique_ptr<ClientConfig> ClientConfig::loadFromClientDirectory(
|
||||
std::unique_ptr<CheckoutConfig> CheckoutConfig::loadFromClientDirectory(
|
||||
AbsolutePathPiece mountPath,
|
||||
AbsolutePathPiece clientDirectory) {
|
||||
// Extract repository name from the client config file
|
||||
auto configPath = clientDirectory + kClientConfig;
|
||||
auto configPath = clientDirectory + kCheckoutConfig;
|
||||
auto configRoot = cpptoml::parse_file(configPath.c_str());
|
||||
|
||||
// Construct ClientConfig object
|
||||
auto config = std::make_unique<ClientConfig>(mountPath, clientDirectory);
|
||||
// Construct CheckoutConfig object
|
||||
auto config = std::make_unique<CheckoutConfig>(mountPath, clientDirectory);
|
||||
|
||||
// Load repository information
|
||||
auto repository = configRoot->get_table(kRepoSection.str());
|
||||
@ -203,7 +204,8 @@ std::unique_ptr<ClientConfig> ClientConfig::loadFromClientDirectory(
|
||||
return config;
|
||||
}
|
||||
|
||||
folly::dynamic ClientConfig::loadClientDirectoryMap(AbsolutePathPiece edenDir) {
|
||||
folly::dynamic CheckoutConfig::loadClientDirectoryMap(
|
||||
AbsolutePathPiece edenDir) {
|
||||
// Extract the JSON and strip any comments.
|
||||
std::string jsonContents;
|
||||
auto configJsonFile = edenDir + kClientDirectoryMap;
|
@ -37,27 +37,35 @@ inline void operator<<(std::ostream& out, const BindMount& bindMount) {
|
||||
<< "; pathInMountDir=" << bindMount.pathInMountDir << "}";
|
||||
}
|
||||
|
||||
class ClientConfig {
|
||||
/**
|
||||
* CheckoutConfig contains the configuration state for a single Eden checkout.
|
||||
*
|
||||
* This data is stored on disk in the file
|
||||
* EDEN_DIR/clients/CHECKOUT_NAME/config.toml
|
||||
*/
|
||||
class CheckoutConfig {
|
||||
public:
|
||||
/**
|
||||
* Manually construct a ClientConfig object.
|
||||
* Manually construct a CheckoutConfig object.
|
||||
*
|
||||
* Note that most callers will probably want to use the
|
||||
* loadFromClientDirectory() factory function to create a ClientConfig object
|
||||
* from an existing client directory, rather than directly calling this
|
||||
* loadFromClientDirectory() factory function to create a CheckoutConfig
|
||||
* object from an existing client directory, rather than directly calling this
|
||||
* constructor.
|
||||
*/
|
||||
ClientConfig(AbsolutePathPiece mountPath, AbsolutePathPiece clientDirectory);
|
||||
CheckoutConfig(
|
||||
AbsolutePathPiece mountPath,
|
||||
AbsolutePathPiece clientDirectory);
|
||||
|
||||
/**
|
||||
* Load a ClientConfig object from the edenrc file in a client directory.
|
||||
* Load a CheckoutConfig object from the edenrc file in a client directory.
|
||||
*
|
||||
* @param mountPath The path where the client is (or will be) mounted.
|
||||
* @param clientDirectory The eden client data directory, where the client
|
||||
* configuration file can be found (along with its overlay and other
|
||||
* data).
|
||||
*/
|
||||
static std::unique_ptr<ClientConfig> loadFromClientDirectory(
|
||||
static std::unique_ptr<CheckoutConfig> loadFromClientDirectory(
|
||||
AbsolutePathPiece mountPath,
|
||||
AbsolutePathPiece clientDirectory);
|
||||
|
||||
@ -114,7 +122,7 @@ class ClientConfig {
|
||||
const AbsolutePath& getClientDirectory() const;
|
||||
|
||||
private:
|
||||
ClientConfig(
|
||||
CheckoutConfig(
|
||||
AbsolutePathPiece clientDirectory,
|
||||
AbsolutePathPiece mountPath,
|
||||
std::vector<BindMount>&& bindMounts);
|
@ -7,7 +7,7 @@
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
*/
|
||||
#include "eden/fs/config/ClientConfig.h"
|
||||
#include "eden/fs/config/CheckoutConfig.h"
|
||||
|
||||
#include <folly/FileUtil.h>
|
||||
#include <folly/experimental/TestUtil.h>
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
using facebook::eden::AbsolutePath;
|
||||
using facebook::eden::BindMount;
|
||||
using facebook::eden::ClientConfig;
|
||||
using facebook::eden::CheckoutConfig;
|
||||
using facebook::eden::Hash;
|
||||
using facebook::eden::RelativePath;
|
||||
using folly::StringPiece;
|
||||
@ -27,7 +27,7 @@ namespace {
|
||||
|
||||
using folly::test::TemporaryDirectory;
|
||||
|
||||
class ClientConfigTest : public ::testing::Test {
|
||||
class CheckoutConfigTest : public ::testing::Test {
|
||||
protected:
|
||||
std::unique_ptr<TemporaryDirectory> edenDir_;
|
||||
folly::fs::path clientDir_;
|
||||
@ -67,8 +67,8 @@ class ClientConfigTest : public ::testing::Test {
|
||||
};
|
||||
} // namespace
|
||||
|
||||
TEST_F(ClientConfigTest, testLoadFromClientDirectory) {
|
||||
auto config = ClientConfig::loadFromClientDirectory(
|
||||
TEST_F(CheckoutConfigTest, testLoadFromClientDirectory) {
|
||||
auto config = CheckoutConfig::loadFromClientDirectory(
|
||||
AbsolutePath{mountPoint_.string()}, AbsolutePath{clientDir_.string()});
|
||||
|
||||
auto parents = config->getParentCommits();
|
||||
@ -86,7 +86,7 @@ TEST_F(ClientConfigTest, testLoadFromClientDirectory) {
|
||||
EXPECT_EQ(expectedBindMounts, config->getBindMounts());
|
||||
}
|
||||
|
||||
TEST_F(ClientConfigTest, testLoadFromClientDirectoryWithNoBindMounts) {
|
||||
TEST_F(CheckoutConfigTest, testLoadFromClientDirectoryWithNoBindMounts) {
|
||||
// Overwrite config.toml with no bind-mounts entry.
|
||||
auto data =
|
||||
"[repository]\n"
|
||||
@ -94,7 +94,7 @@ TEST_F(ClientConfigTest, testLoadFromClientDirectoryWithNoBindMounts) {
|
||||
"type = \"git\"\n";
|
||||
folly::writeFile(folly::StringPiece{data}, configDotToml_.c_str());
|
||||
|
||||
auto config = ClientConfig::loadFromClientDirectory(
|
||||
auto config = CheckoutConfig::loadFromClientDirectory(
|
||||
AbsolutePath{mountPoint_.string()}, AbsolutePath{clientDir_.string()});
|
||||
|
||||
auto parents = config->getParentCommits();
|
||||
@ -107,8 +107,8 @@ TEST_F(ClientConfigTest, testLoadFromClientDirectoryWithNoBindMounts) {
|
||||
EXPECT_EQ(expectedBindMounts, config->getBindMounts());
|
||||
}
|
||||
|
||||
TEST_F(ClientConfigTest, testMultipleParents) {
|
||||
auto config = ClientConfig::loadFromClientDirectory(
|
||||
TEST_F(CheckoutConfigTest, testMultipleParents) {
|
||||
auto config = CheckoutConfig::loadFromClientDirectory(
|
||||
AbsolutePath{mountPoint_.string()}, AbsolutePath{clientDir_.string()});
|
||||
|
||||
// Overwrite the SNAPSHOT file to indicate that there are two parents
|
||||
@ -129,8 +129,8 @@ TEST_F(ClientConfigTest, testMultipleParents) {
|
||||
Hash{"abcdef98765432100123456789abcdef00112233"}, parents.parent2());
|
||||
}
|
||||
|
||||
TEST_F(ClientConfigTest, testWriteSnapshot) {
|
||||
auto config = ClientConfig::loadFromClientDirectory(
|
||||
TEST_F(CheckoutConfigTest, testWriteSnapshot) {
|
||||
auto config = CheckoutConfig::loadFromClientDirectory(
|
||||
AbsolutePath{mountPoint_.string()}, AbsolutePath{clientDir_.string()});
|
||||
|
||||
Hash hash1{"99887766554433221100aabbccddeeffabcdef99"};
|
||||
@ -170,19 +170,19 @@ TEST_F(ClientConfigTest, testWriteSnapshot) {
|
||||
}
|
||||
|
||||
template <typename ExceptionType>
|
||||
void ClientConfigTest::testBadSnapshot(
|
||||
void CheckoutConfigTest::testBadSnapshot(
|
||||
StringPiece contents,
|
||||
const char* errorRegex) {
|
||||
SCOPED_TRACE(
|
||||
folly::to<std::string>("SNAPSHOT contents: ", folly::hexlify(contents)));
|
||||
folly::writeFile(contents, (clientDir_ / "SNAPSHOT").c_str());
|
||||
|
||||
auto config = ClientConfig::loadFromClientDirectory(
|
||||
auto config = CheckoutConfig::loadFromClientDirectory(
|
||||
AbsolutePath{mountPoint_.string()}, AbsolutePath{clientDir_.string()});
|
||||
EXPECT_THROW_RE(config->getParentCommits(), ExceptionType, errorRegex);
|
||||
}
|
||||
|
||||
TEST_F(ClientConfigTest, testBadSnapshot) {
|
||||
TEST_F(CheckoutConfigTest, testBadSnapshot) {
|
||||
testBadSnapshot("eden", "SNAPSHOT file is too short");
|
||||
testBadSnapshot(StringPiece{"eden\0\0\0", 7}, "SNAPSHOT file is too short");
|
||||
testBadSnapshot(
|
@ -24,7 +24,7 @@
|
||||
#include <folly/Subprocess.h>
|
||||
#endif
|
||||
|
||||
#include "eden/fs/config/ClientConfig.h"
|
||||
#include "eden/fs/config/CheckoutConfig.h"
|
||||
#include "eden/fs/fuse/FuseChannel.h"
|
||||
#include "eden/fs/fuse/privhelper/PrivHelper.h"
|
||||
#include "eden/fs/inodes/CheckoutContext.h"
|
||||
@ -171,7 +171,7 @@ static const uint64_t globalProcessGeneration =
|
||||
static std::atomic<uint16_t> mountGeneration{0};
|
||||
|
||||
std::shared_ptr<EdenMount> EdenMount::create(
|
||||
std::unique_ptr<ClientConfig> config,
|
||||
std::unique_ptr<CheckoutConfig> config,
|
||||
std::shared_ptr<ObjectStore> objectStore,
|
||||
std::shared_ptr<BlobCache> blobCache,
|
||||
std::shared_ptr<ServerState> serverState) {
|
||||
@ -183,7 +183,7 @@ std::shared_ptr<EdenMount> EdenMount::create(
|
||||
}
|
||||
|
||||
EdenMount::EdenMount(
|
||||
std::unique_ptr<ClientConfig> config,
|
||||
std::unique_ptr<CheckoutConfig> config,
|
||||
std::shared_ptr<ObjectStore> objectStore,
|
||||
std::shared_ptr<BlobCache> blobCache,
|
||||
std::shared_ptr<ServerState> serverState)
|
||||
|
@ -47,8 +47,8 @@ namespace eden {
|
||||
|
||||
class BindMount;
|
||||
class BlobCache;
|
||||
class CheckoutConfig;
|
||||
class CheckoutConflict;
|
||||
class ClientConfig;
|
||||
class Clock;
|
||||
class DiffContext;
|
||||
class EdenDispatcher;
|
||||
@ -114,7 +114,7 @@ class EdenMount {
|
||||
* called on the EdenMount until initialize() has successfully completed.
|
||||
*/
|
||||
static std::shared_ptr<EdenMount> create(
|
||||
std::unique_ptr<ClientConfig> config,
|
||||
std::unique_ptr<CheckoutConfig> config,
|
||||
std::shared_ptr<ObjectStore> objectStore,
|
||||
std::shared_ptr<BlobCache> blobCache,
|
||||
std::shared_ptr<ServerState> serverState);
|
||||
@ -233,7 +233,7 @@ class EdenMount {
|
||||
|
||||
/*
|
||||
* Return bind mounts that are applied for this mount. These are based on the
|
||||
* state of the ClientConfig when this EdenMount was created.
|
||||
* state of the CheckoutConfig when this EdenMount was created.
|
||||
*/
|
||||
const std::vector<BindMount>& getBindMounts() const;
|
||||
|
||||
@ -300,7 +300,7 @@ class EdenMount {
|
||||
return mountGeneration_;
|
||||
}
|
||||
|
||||
const ClientConfig* getConfig() const {
|
||||
const CheckoutConfig* getConfig() const {
|
||||
return config_.get();
|
||||
}
|
||||
|
||||
@ -614,7 +614,7 @@ class EdenMount {
|
||||
void transitionToFuseInitializationErrorState();
|
||||
|
||||
EdenMount(
|
||||
std::unique_ptr<ClientConfig> config,
|
||||
std::unique_ptr<CheckoutConfig> config,
|
||||
std::shared_ptr<ObjectStore> objectStore,
|
||||
std::shared_ptr<BlobCache> blobCache,
|
||||
std::shared_ptr<ServerState> serverState);
|
||||
@ -675,7 +675,7 @@ class EdenMount {
|
||||
|
||||
static constexpr int kMaxSymlinkChainDepth = 40; // max depth of symlink chain
|
||||
|
||||
const std::unique_ptr<const ClientConfig> config_;
|
||||
const std::unique_ptr<const CheckoutConfig> config_;
|
||||
|
||||
/**
|
||||
* A promise associated with the future returned from
|
||||
@ -724,7 +724,7 @@ class EdenMount {
|
||||
|
||||
/*
|
||||
* Note that this config will not be updated if the user modifies the
|
||||
* underlying config files after the ClientConfig was created.
|
||||
* underlying config files after the CheckoutConfig was created.
|
||||
*/
|
||||
const std::vector<BindMount> bindMounts_;
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include <stdexcept>
|
||||
#include <utility>
|
||||
|
||||
#include "eden/fs/config/ClientConfig.h"
|
||||
#include "eden/fs/config/CheckoutConfig.h"
|
||||
#include "eden/fs/inodes/InodeError.h"
|
||||
#include "eden/fs/inodes/InodeMap.h"
|
||||
#include "eden/fs/inodes/TreeInode.h"
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include <thrift/lib/cpp2/server/ThriftServer.h>
|
||||
|
||||
#include "common/stats/ServiceData.h"
|
||||
#include "eden/fs/config/ClientConfig.h"
|
||||
#include "eden/fs/config/CheckoutConfig.h"
|
||||
#include "eden/fs/tracing/EdenStats.h"
|
||||
#ifdef EDEN_WIN
|
||||
#include "eden/win/fs/mount/EdenMount.h" // @manual
|
||||
@ -537,7 +537,7 @@ std::vector<Future<Unit>> EdenServer::prepareMountsTakeover(
|
||||
const auto stateDirectory = info.stateDirectory;
|
||||
auto mountFuture =
|
||||
makeFutureWith([&] {
|
||||
auto initialConfig = ClientConfig::loadFromClientDirectory(
|
||||
auto initialConfig = CheckoutConfig::loadFromClientDirectory(
|
||||
AbsolutePathPiece{info.mountPath},
|
||||
AbsolutePathPiece{info.stateDirectory});
|
||||
return mount(std::move(initialConfig), std::move(info));
|
||||
@ -569,7 +569,7 @@ std::vector<Future<Unit>> EdenServer::prepareMounts(
|
||||
std::vector<Future<Unit>> mountFutures;
|
||||
folly::dynamic dirs = folly::dynamic::object();
|
||||
try {
|
||||
dirs = ClientConfig::loadClientDirectoryMap(edenDir_.getPath());
|
||||
dirs = CheckoutConfig::loadClientDirectoryMap(edenDir_.getPath());
|
||||
} catch (const std::exception& ex) {
|
||||
logger->warn(
|
||||
"Could not parse config.json file: ",
|
||||
@ -594,7 +594,7 @@ std::vector<Future<Unit>> EdenServer::prepareMounts(
|
||||
auto edenClientPath =
|
||||
edenDir_.getCheckoutStateDir(client.second.asString());
|
||||
mountInfo.edenClientPath = edenClientPath.stringPiece().str();
|
||||
auto initialConfig = ClientConfig::loadFromClientDirectory(
|
||||
auto initialConfig = CheckoutConfig::loadFromClientDirectory(
|
||||
AbsolutePathPiece{mountInfo.mountPoint},
|
||||
AbsolutePathPiece{mountInfo.edenClientPath});
|
||||
return mount(std::move(initialConfig));
|
||||
@ -791,7 +791,7 @@ Future<Unit> EdenServer::completeTakeoverFuseStart(
|
||||
#endif // !EDEN_WIN
|
||||
|
||||
folly::Future<std::shared_ptr<EdenMount>> EdenServer::mount(
|
||||
std::unique_ptr<ClientConfig> initialConfig,
|
||||
std::unique_ptr<CheckoutConfig> initialConfig,
|
||||
optional<TakeoverData::MountInfo>&& optionalTakeover) {
|
||||
auto backingStore = getBackingStore(
|
||||
initialConfig->getRepoType(), initialConfig->getRepoSource());
|
||||
|
@ -181,7 +181,7 @@ class EdenServer : private TakeoverHandler {
|
||||
* Mount and return an EdenMount.
|
||||
*/
|
||||
FOLLY_NODISCARD folly::Future<std::shared_ptr<EdenMount>> mount(
|
||||
std::unique_ptr<ClientConfig> initialConfig,
|
||||
std::unique_ptr<CheckoutConfig> initialConfig,
|
||||
std::optional<TakeoverData::MountInfo>&& optionalTakeover = std::nullopt);
|
||||
|
||||
/**
|
||||
|
@ -43,7 +43,7 @@
|
||||
#endif // EDEN_WIN
|
||||
|
||||
#include "common/stats/ServiceData.h"
|
||||
#include "eden/fs/config/ClientConfig.h"
|
||||
#include "eden/fs/config/CheckoutConfig.h"
|
||||
#include "eden/fs/model/Blob.h"
|
||||
#include "eden/fs/model/Hash.h"
|
||||
#include "eden/fs/model/Tree.h"
|
||||
@ -275,7 +275,7 @@ facebook::fb303::cpp2::fb_status EdenServiceHandler::getStatus() {
|
||||
void EdenServiceHandler::mount(std::unique_ptr<MountArgument> argument) {
|
||||
auto helper = INSTRUMENT_THRIFT_CALL(INFO, argument->get_mountPoint());
|
||||
try {
|
||||
auto initialConfig = ClientConfig::loadFromClientDirectory(
|
||||
auto initialConfig = CheckoutConfig::loadFromClientDirectory(
|
||||
AbsolutePathPiece{argument->mountPoint},
|
||||
AbsolutePathPiece{argument->edenClientPath});
|
||||
server_->mount(std::move(initialConfig)).get();
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include "eden/fs/config/ClientConfig.h"
|
||||
#include "eden/fs/config/CheckoutConfig.h"
|
||||
#include "eden/fs/config/EdenConfig.h"
|
||||
#include "eden/fs/fuse/FileHandle.h"
|
||||
#include "eden/fs/fuse/privhelper/UserInfo.h"
|
||||
@ -222,8 +222,8 @@ void TestMount::initTestDirectory() {
|
||||
auto mountPath = testDirPath + "mount"_pc;
|
||||
makedir(mountPath);
|
||||
|
||||
// Create the ClientConfig using our newly-populated client directory
|
||||
config_ = make_unique<ClientConfig>(mountPath, clientDirectory);
|
||||
// Create the CheckoutConfig using our newly-populated client directory
|
||||
config_ = make_unique<CheckoutConfig>(mountPath, clientDirectory);
|
||||
|
||||
// Create localStore_ and backingStore_
|
||||
localStore_ = make_shared<MemoryLocalStore>();
|
||||
@ -246,8 +246,8 @@ void TestMount::startFuseAndWait(std::shared_ptr<FakeFuse> fuse) {
|
||||
}
|
||||
|
||||
void TestMount::remount() {
|
||||
// Create a new copy of the ClientConfig
|
||||
auto config = make_unique<ClientConfig>(*edenMount_->getConfig());
|
||||
// Create a new copy of the CheckoutConfig
|
||||
auto config = make_unique<CheckoutConfig>(*edenMount_->getConfig());
|
||||
// Create a new ObjectStore pointing to our local store and backing store
|
||||
auto objectStore = ObjectStore::create(localStore_, backingStore_);
|
||||
|
||||
@ -269,8 +269,8 @@ void TestMount::remount() {
|
||||
}
|
||||
|
||||
void TestMount::remountGracefully() {
|
||||
// Create a new copy of the ClientConfig
|
||||
auto config = make_unique<ClientConfig>(*edenMount_->getConfig());
|
||||
// Create a new copy of the CheckoutConfig
|
||||
auto config = make_unique<CheckoutConfig>(*edenMount_->getConfig());
|
||||
// Create a new ObjectStore pointing to our local store and backing store
|
||||
auto objectStore = ObjectStore::create(localStore_, backingStore_);
|
||||
|
||||
|
@ -33,7 +33,7 @@ class ManualExecutor;
|
||||
namespace facebook {
|
||||
namespace eden {
|
||||
class BlobCache;
|
||||
class ClientConfig;
|
||||
class CheckoutConfig;
|
||||
class FakeBackingStore;
|
||||
class FakeFuse;
|
||||
class FakePrivHelper;
|
||||
@ -164,12 +164,12 @@ class TestMount {
|
||||
void startFuseAndWait(std::shared_ptr<FakeFuse>);
|
||||
|
||||
/**
|
||||
* Get the ClientConfig object.
|
||||
* Get the CheckoutConfig object.
|
||||
*
|
||||
* The ClientConfig object provides methods to get the paths to the mount
|
||||
* The CheckoutConfig object provides methods to get the paths to the mount
|
||||
* point, the client directory, etc.
|
||||
*/
|
||||
ClientConfig* getConfig() const {
|
||||
CheckoutConfig* getConfig() const {
|
||||
return config_.get();
|
||||
}
|
||||
|
||||
@ -350,7 +350,7 @@ class TestMount {
|
||||
* config_ is only set before edenMount_ has been initialized.
|
||||
* When edenMount_ is created we pass ownership of the config to edenMount_.
|
||||
*/
|
||||
std::unique_ptr<ClientConfig> config_;
|
||||
std::unique_ptr<CheckoutConfig> config_;
|
||||
|
||||
/**
|
||||
* A counter for creating temporary commit hashes via the nextCommitHash()
|
||||
|
@ -159,7 +159,7 @@
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\fs\config\ClientConfig.cpp" />
|
||||
<ClCompile Include="..\..\fs\config\CheckoutConfig.cpp" />
|
||||
<ClCompile Include="..\..\fs\config\EdenConfig.cpp" />
|
||||
<ClCompile Include="..\..\fs\config\FileChangeMonitor.cpp" />
|
||||
<ClCompile Include="..\..\fs\config\ReloadableConfig.cpp" />
|
||||
@ -244,7 +244,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\fs\config\CachedParsedFileMonitor.h" />
|
||||
<ClInclude Include="..\..\fs\config\ClientConfig.h" />
|
||||
<ClInclude Include="..\..\fs\config\CheckoutConfig.h" />
|
||||
<ClInclude Include="..\..\fs\config\EdenConfig.h" />
|
||||
<ClInclude Include="..\..\fs\config\FileChangeMonitor.h" />
|
||||
<ClInclude Include="..\..\fs\config\ReloadableConfig.h" />
|
||||
|
@ -185,7 +185,7 @@
|
||||
<ClCompile Include="..\..\fs\model\git\GlobMatcher.cpp">
|
||||
<Filter>fs\Model\Git</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\fs\config\ClientConfig.cpp">
|
||||
<ClCompile Include="..\..\fs\config\CheckoutConfig.cpp">
|
||||
<Filter>fs\Config</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\fs\config\EdenConfig.cpp">
|
||||
@ -451,7 +451,7 @@
|
||||
<ClInclude Include="..\..\fs\config\CachedParsedFileMonitor.h">
|
||||
<Filter>fs\Config</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\fs\config\ClientConfig.h">
|
||||
<ClInclude Include="..\..\fs\config\CheckoutConfig.h">
|
||||
<Filter>fs\Config</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\fs\config\EdenConfig.h">
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include "eden/win/fs/mount/EdenMount.h"
|
||||
|
||||
#include "eden/fs/config/ClientConfig.h"
|
||||
#include "eden/fs/config/CheckoutConfig.h"
|
||||
#include "eden/fs/model/Hash.h"
|
||||
#include "eden/fs/model/Tree.h"
|
||||
#include "eden/fs/model/git/GitIgnoreStack.h"
|
||||
@ -37,7 +37,7 @@ static uint64_t generateLuid() {
|
||||
}
|
||||
|
||||
std::shared_ptr<EdenMount> EdenMount::create(
|
||||
std::unique_ptr<ClientConfig> config,
|
||||
std::unique_ptr<CheckoutConfig> config,
|
||||
std::shared_ptr<ObjectStore> objectStore,
|
||||
std::shared_ptr<ServerState> serverState) {
|
||||
return std::shared_ptr<EdenMount>(
|
||||
@ -47,7 +47,7 @@ std::shared_ptr<EdenMount> EdenMount::create(
|
||||
}
|
||||
|
||||
EdenMount::EdenMount(
|
||||
std::unique_ptr<ClientConfig> config,
|
||||
std::unique_ptr<CheckoutConfig> config,
|
||||
std::shared_ptr<ObjectStore> objectStore,
|
||||
std::shared_ptr<ServerState> serverState)
|
||||
: config_{std::move(config)},
|
||||
|
@ -42,8 +42,8 @@ namespace facebook {
|
||||
namespace eden {
|
||||
|
||||
class BindMount;
|
||||
class CheckoutConfig;
|
||||
class CheckoutConflict;
|
||||
class ClientConfig;
|
||||
class Clock;
|
||||
class DiffContext;
|
||||
class EdenDispatcher;
|
||||
@ -101,7 +101,7 @@ class EdenMount {
|
||||
* prior to the logic in initialize() running.
|
||||
*/
|
||||
static std::shared_ptr<EdenMount> create(
|
||||
std::unique_ptr<ClientConfig> config,
|
||||
std::unique_ptr<CheckoutConfig> config,
|
||||
std::shared_ptr<ObjectStore> objectStore,
|
||||
std::shared_ptr<ServerState> serverState);
|
||||
|
||||
@ -160,7 +160,7 @@ class EdenMount {
|
||||
return mountGeneration_;
|
||||
}
|
||||
|
||||
const ClientConfig* getConfig() const {
|
||||
const CheckoutConfig* getConfig() const {
|
||||
return config_.get();
|
||||
}
|
||||
|
||||
@ -356,7 +356,7 @@ class EdenMount {
|
||||
bool doStateTransition(State expected, State newState);
|
||||
|
||||
EdenMount(
|
||||
std::unique_ptr<ClientConfig> config,
|
||||
std::unique_ptr<CheckoutConfig> config,
|
||||
std::shared_ptr<ObjectStore> objectStore,
|
||||
std::shared_ptr<ServerState> serverState);
|
||||
|
||||
@ -385,7 +385,7 @@ class EdenMount {
|
||||
|
||||
static constexpr int kMaxSymlinkChainDepth = 40; // max depth of symlink chain
|
||||
|
||||
const std::unique_ptr<const ClientConfig> config_;
|
||||
const std::unique_ptr<const CheckoutConfig> config_;
|
||||
|
||||
/**
|
||||
* Eden server state shared across multiple mount points.
|
||||
@ -420,7 +420,7 @@ class EdenMount {
|
||||
|
||||
/*
|
||||
* Note that this config will not be updated if the user modifies the
|
||||
* underlying config files after the ClientConfig was created.
|
||||
* underlying config files after the CheckoutConfig was created.
|
||||
*/
|
||||
const std::vector<BindMount> bindMounts_;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user