sapling/eden/scm/lib/backingstore/c_api/HgNativeBackingStore.h
Zeyi (Rice) Fan ae1dae6b96 eden: add experimental:use-edenapi for optionally turn on EdenApi importing
Summary:
Add an option `experimental:use-edenapi` to `EdenConfig`.

See the next diff for usage.

Reviewed By: chadaustin

Differential Revision: D18605549

fbshipit-source-id: 2786c21bb38a76229078662cc5c1ddf906d1be4a
2019-12-10 13:40:55 -08:00

37 lines
811 B
C++

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
#pragma once
#include <folly/Range.h>
#include <memory>
#include "eden/scm/lib/backingstore/c_api/RustBackingStore.h"
namespace folly {
class IOBuf;
} // namespace folly
namespace facebook {
namespace eden {
class HgNativeBackingStore {
public:
HgNativeBackingStore(folly::StringPiece repository, bool useEdenApi);
std::unique_ptr<folly::IOBuf> getBlob(
folly::ByteRange name,
folly::ByteRange node);
std::shared_ptr<RustTree> getTree(folly::ByteRange node);
private:
std::unique_ptr<RustBackingStore, std::function<void(RustBackingStore*)>>
store_;
};
} // namespace eden
} // namespace facebook