mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 08:18:15 +03:00
Pass getTreeEntryForRootId to ObjectStore
Summary: This will add the same getTreeEntryForRootId to ObjectStore Reviewed By: chadaustin Differential Revision: D29920475 fbshipit-source-id: 15bfc6a2ba70cce2095dfcf1f434fd7087605e04
This commit is contained in:
parent
a721dd3ef3
commit
ff67f9214e
@ -138,6 +138,21 @@ Future<shared_ptr<const Tree>> ObjectStore::getRootTree(
|
||||
});
|
||||
}
|
||||
|
||||
folly::Future<std::shared_ptr<TreeEntry>> ObjectStore::getTreeEntryForRootId(
|
||||
const RootId& rootId,
|
||||
facebook::eden::TreeEntryType treeEntryType,
|
||||
facebook::eden::PathComponentPiece pathComponentPiece,
|
||||
ObjectFetchContext& context) const {
|
||||
XLOG(DBG3) << "getTreeEntryForRootId(" << rootId << ")";
|
||||
|
||||
// TODO: We can cache the treeEntry to the localStore like Tree or
|
||||
// blob
|
||||
return backingStore_
|
||||
->getTreeEntryForRootId(
|
||||
rootId, treeEntryType, pathComponentPiece, context)
|
||||
.via(executor_);
|
||||
}
|
||||
|
||||
Future<shared_ptr<const Tree>> ObjectStore::getTree(
|
||||
const Hash& id,
|
||||
ObjectFetchContext& fetchContext) const {
|
||||
|
@ -131,6 +131,19 @@ class ObjectStore : public IObjectStore,
|
||||
const RootId& rootId,
|
||||
ObjectFetchContext& context) const override;
|
||||
|
||||
/**
|
||||
* Get a TreeEntry by ID
|
||||
*
|
||||
* This returns a Future object that will produce the TreeEntry when it is
|
||||
* ready. It may result in a std::domain_error if the specified tree ID does
|
||||
* not exist, or possibly other exceptions on error.
|
||||
*/
|
||||
folly::Future<std::shared_ptr<TreeEntry>> getTreeEntryForRootId(
|
||||
const RootId& rootId,
|
||||
facebook::eden::TreeEntryType treeEntryType,
|
||||
facebook::eden::PathComponentPiece pathComponentPiece,
|
||||
ObjectFetchContext& context) const;
|
||||
|
||||
/**
|
||||
* Get a Tree by ID.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user