mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
mononoke: rename blobrepo functions
Summary: We are going to use them to fetch not only file blobs, but also tree blobs. Reviewed By: kulshrax Differential Revision: D6336010 fbshipit-source-id: 77fcc45698a447c10d180baf929465f1d7e4ee72
This commit is contained in:
parent
3dc2bd685e
commit
2560d9ce73
@ -28,10 +28,7 @@ pub struct BlobEntry<B> {
|
|||||||
ty: Type,
|
ty: Type,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fetch_file_blob_from_blobstore<B>(
|
pub fn fetch_blob_from_blobstore<B>(blobstore: B, nodeid: NodeHash) -> BoxFuture<Vec<u8>, Error>
|
||||||
blobstore: B,
|
|
||||||
nodeid: NodeHash,
|
|
||||||
) -> BoxFuture<Vec<u8>, Error>
|
|
||||||
where
|
where
|
||||||
B: Blobstore<Key = String> + Clone,
|
B: Blobstore<Key = String> + Clone,
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,7 @@ use BlobChangeset;
|
|||||||
use BlobManifest;
|
use BlobManifest;
|
||||||
use BlobState;
|
use BlobState;
|
||||||
use errors::*;
|
use errors::*;
|
||||||
use file::fetch_file_blob_from_blobstore;
|
use file::fetch_blob_from_blobstore;
|
||||||
|
|
||||||
pub struct BlobRepo<State> {
|
pub struct BlobRepo<State> {
|
||||||
inner: Arc<State>,
|
inner: Arc<State>,
|
||||||
@ -39,8 +39,8 @@ impl<State> BlobRepo<State>
|
|||||||
where
|
where
|
||||||
State: BlobState,
|
State: BlobState,
|
||||||
{
|
{
|
||||||
pub fn get_file_blob(&self, key: &NodeHash) -> BoxFuture<Vec<u8>, Error> {
|
pub fn get_blob(&self, key: &NodeHash) -> BoxFuture<Vec<u8>, Error> {
|
||||||
fetch_file_blob_from_blobstore(self.inner.blobstore().clone(), *key)
|
fetch_blob_from_blobstore(self.inner.blobstore().clone(), *key)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -239,7 +239,7 @@ where
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
repo.get_file_blob(hash)
|
repo.get_blob(hash)
|
||||||
.from_err()
|
.from_err()
|
||||||
.and_then(|content| futures::future::ok(content))
|
.and_then(|content| futures::future::ok(content))
|
||||||
.boxify()
|
.boxify()
|
||||||
|
Loading…
Reference in New Issue
Block a user