Enable hg update on Eden Windows

Summary: This diff enables running source control update and rebase operations on Eden Windows clones.

Reviewed By: wez

Differential Revision: D20480873

fbshipit-source-id: 9e7cd6acdd9aedc87ddfe126718f48509d1d7c4f
This commit is contained in:
Puneet Kaushik 2020-04-24 12:42:38 -07:00 committed by Facebook GitHub Bot
parent 4fb5762206
commit be9628b2bc
2 changed files with 7 additions and 5 deletions

View File

@ -10,6 +10,7 @@
#include <boost/filesystem.hpp>
#include <folly/ExceptionWrapper.h>
#include <folly/FBString.h>
#include <folly/stop_watch.h>
#include <folly/chrono/Conv.h>
#include <folly/futures/Future.h>
@ -21,6 +22,7 @@
#include "eden/fs/config/CheckoutConfig.h"
#include "eden/fs/config/EdenConfig.h"
#include "eden/fs/inodes/CheckoutContext.h"
#include "eden/fs/inodes/FileInode.h"
#include "eden/fs/inodes/InodeError.h"
#include "eden/fs/inodes/InodeMap.h"
@ -54,7 +56,6 @@
#include <folly/Subprocess.h>
#include "eden/fs/fuse/FuseChannel.h"
#include "eden/fs/fuse/privhelper/PrivHelper.h"
#include "eden/fs/inodes/CheckoutContext.h"
#include "eden/fs/inodes/EdenDispatcher.h"
#include "eden/fs/inodes/InodeTable.h"
#include "eden/fs/utils/FutureSubprocess.h"
@ -808,6 +809,7 @@ folly::Future<InodePtr> EdenMount::resolveSymlinkImpl(
});
});
}
#endif
folly::Future<CheckoutResult> EdenMount::checkout(
Hash snapshotHash,
@ -895,6 +897,7 @@ folly::Future<CheckoutResult> EdenMount::checkout(
ctx->start(this->acquireRenameLock());
checkoutTimes->didAcquireRenameLock = stopWatch.elapsed();
#ifndef _WIN32
/**
* If a significant number of tree inodes are loaded or referenced
@ -915,6 +918,8 @@ folly::Future<CheckoutResult> EdenMount::checkout(
*/
this->getRootInode()->unloadChildrenUnreferencedByFuse();
#endif // !1
return this->getRootInode()->checkout(ctx.get(), fromTree, toTree);
})
.thenValue([ctx, checkoutTimes, stopWatch, snapshotHash](auto&&) {
@ -998,6 +1003,7 @@ folly::Future<CheckoutResult> EdenMount::checkout(
});
}
#ifndef _WIN32
folly::Future<folly::Unit> EdenMount::chown(uid_t uid, gid_t gid) {
// 1) Ensure that all future opens will by default provide this owner
setOwner(uid, gid);

View File

@ -374,7 +374,6 @@ void EdenServiceHandler::checkOutRevision(
std::unique_ptr<std::string> mountPoint,
std::unique_ptr<std::string> hash,
CheckoutMode checkoutMode) {
#ifndef _WIN32
auto helper = INSTRUMENT_THRIFT_CALL(
DBG1,
*mountPoint,
@ -385,9 +384,6 @@ void EdenServiceHandler::checkOutRevision(
auto edenMount = server_->getMount(*mountPoint);
auto checkoutFuture = edenMount->checkout(hashObj, checkoutMode);
results = std::move(std::move(checkoutFuture).get().conflicts);
#else
NOT_IMPLEMENTED();
#endif // !_WIN32
}
void EdenServiceHandler::resetParentCommits(