mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
derived_data: remove old futures version of BonsaiDerived::derive
Summary: Now that all code is using `BonsaiDerived::derive03`, we can remove the old futures version `BonsaiDerived::derive`. Reviewed By: krallin Differential Revision: D24900108 fbshipit-source-id: 885d903d4a45e639e4d44e19b5d70fac26bce279
This commit is contained in:
parent
37ab107de9
commit
383e60ed8c
@ -11,9 +11,7 @@ use anyhow::Error;
|
||||
use async_trait::async_trait;
|
||||
use blobrepo::BlobRepo;
|
||||
use context::CoreContext;
|
||||
use futures::future::{FutureExt, TryFutureExt};
|
||||
use futures::stream::{self, StreamExt, TryStreamExt};
|
||||
use futures_ext::{BoxFuture as BoxFuture01, FutureExt as _};
|
||||
use lock_ext::LockExt;
|
||||
use mononoke_types::{BonsaiChangeset, ChangesetId, RepositoryId};
|
||||
use std::{
|
||||
@ -71,34 +69,6 @@ pub trait BonsaiDerived: Sized + 'static + Send + Sync + Clone {
|
||||
parents: Vec<Self>,
|
||||
) -> Result<Self, Error>;
|
||||
|
||||
/// TODO(ahornby) delete onces all callsites using ::derive03
|
||||
///
|
||||
/// This function is the entrypoint for changeset derivation, it converts
|
||||
/// bonsai representation to derived one by calling derive_from_parents(), and saves mapping
|
||||
/// from csid -> BonsaiDerived in BonsaiDerivedMapping
|
||||
///
|
||||
/// This function fails immediately if this type of derived data is not enabled for this repo.
|
||||
fn derive(
|
||||
ctx: CoreContext,
|
||||
repo: BlobRepo,
|
||||
csid: ChangesetId,
|
||||
) -> BoxFuture01<Self, DeriveError> {
|
||||
async move {
|
||||
let mapping = Self::mapping(&ctx, &repo);
|
||||
derive_impl::derive_impl::<Self, Self::Mapping>(
|
||||
&ctx,
|
||||
&repo,
|
||||
&mapping,
|
||||
csid,
|
||||
Mode::OnlyIfEnabled,
|
||||
)
|
||||
.await
|
||||
}
|
||||
.boxed()
|
||||
.compat()
|
||||
.boxify()
|
||||
}
|
||||
|
||||
/// This function is the entrypoint for changeset derivation, it converts
|
||||
/// bonsai representation to derived one by calling derive_from_parents(), and saves mapping
|
||||
/// from csid -> BonsaiDerived in BonsaiDerivedMapping
|
||||
|
Loading…
Reference in New Issue
Block a user