Skip to content

Commit

Permalink
mononoke/mercurial_types: remove unused ContentBlobInfo
Browse files Browse the repository at this point in the history
Summary:
This contains a path, which it turns out is actually never used throughout the
codebase. Remove it.

Reviewed By: markbt

Differential Revision: D25122292

fbshipit-source-id: eab528bfb1e3893bca4d92d62c30499cf9eead6c
  • Loading branch information
krallin authored and facebook-github-bot committed Nov 26, 2020
1 parent 636536b commit 34fbac3
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 28 deletions.
3 changes: 1 addition & 2 deletions eden/mononoke/mercurial/types/src/blobs/mod.rs
Expand Up @@ -32,6 +32,5 @@ pub mod filenode_lookup;

mod upload;
pub use upload::{
ContentBlobInfo, ContentBlobMeta, UploadHgFileContents, UploadHgFileEntry, UploadHgNodeHash,
UploadHgTreeEntry,
ContentBlobMeta, UploadHgFileContents, UploadHgFileEntry, UploadHgNodeHash, UploadHgTreeEntry,
};
12 changes: 2 additions & 10 deletions eden/mononoke/mercurial/types/src/blobs/upload.rs
Expand Up @@ -40,14 +40,6 @@ define_stats! {
upload_blob: timeseries(Rate, Sum),
}

/// Information about a content blob associated with a push that is available in
/// the blobstore. (This blob wasn't necessarily uploaded in this push.)
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct ContentBlobInfo {
pub path: MPath,
pub meta: ContentBlobMeta,
}

/// Metadata associated with a content blob being uploaded as part of changeset creation.
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct ContentBlobMeta {
Expand Down Expand Up @@ -405,7 +397,7 @@ impl UploadHgFileEntry {
self,
ctx: CoreContext,
blobstore: Arc<dyn Blobstore>,
) -> Result<(ContentBlobInfo, BoxFuture<(HgBlobEntry, RepoPath), Error>)> {
) -> Result<(ContentBlobMeta, BoxFuture<(HgBlobEntry, RepoPath), Error>)> {
STATS::upload_hg_file_entry.add_value(1);
let UploadHgFileEntry {
upload_node_id,
Expand Down Expand Up @@ -492,7 +484,7 @@ impl UploadHgFileEntry {
let fut = envelope_upload
.join(content_upload)
.map(move |(envelope_res, ())| envelope_res);
Ok((ContentBlobInfo { path, meta: cbmeta }, fut.boxify()))
Ok((cbmeta, fut.boxify()))
}

fn log_stats(
Expand Down
10 changes: 5 additions & 5 deletions eden/mononoke/repo_client/unbundle/src/changegroup/filelog.rs
Expand Up @@ -28,8 +28,8 @@ use filestore::FetchKey;
use mercurial_bundles::changegroup::CgDeltaChunk;
use mercurial_types::{
blobs::{
ContentBlobInfo, ContentBlobMeta, File, HgBlobEntry, UploadHgFileContents,
UploadHgFileEntry, UploadHgNodeHash,
ContentBlobMeta, File, HgBlobEntry, UploadHgFileContents, UploadHgFileEntry,
UploadHgNodeHash,
},
delta, Delta, FileType, HgFileNodeId, HgNodeHash, HgNodeKey, MPath, RepoPath, RevFlags,
NULL_HASH,
Expand Down Expand Up @@ -68,7 +68,7 @@ impl UploadableHgBlob for Filelog {
// SharedError) doesn't implement Fail, and only implements Error if the wrapped type
// implements Error.
type Value = (
ContentBlobInfo,
ContentBlobMeta,
Shared<BoxFuture<(HgBlobEntry, RepoPath), Compat<Error>>>,
);

Expand Down Expand Up @@ -97,8 +97,8 @@ impl UploadableHgBlob for Filelog {
path,
};

let (cbinfo, fut) = upload.upload(ctx, repo.get_blobstore().boxed())?;
Ok((node_key, (cbinfo, fut.map_err(Compat).boxify().shared())))
let (cbmeta, fut) = upload.upload(ctx, repo.get_blobstore().boxed())?;
Ok((node_key, (cbmeta, fut.map_err(Compat).boxify().shared())))
}
}

Expand Down
4 changes: 2 additions & 2 deletions eden/mononoke/repo_client/unbundle/src/resolver.rs
Expand Up @@ -42,7 +42,7 @@ use mercurial_bundles::{
use mercurial_mutation::HgMutationEntry;
use mercurial_revlog::changeset::RevlogChangeset;
use mercurial_types::{
blobs::{ContentBlobInfo, HgBlobEntry},
blobs::{ContentBlobMeta, HgBlobEntry},
HgChangesetId, HgNodeKey, RepoPath,
};
use metaconfig_types::{PushrebaseFlags, RepoReadOnly};
Expand Down Expand Up @@ -77,7 +77,7 @@ mod UNBUNDLE_STATS {
pub type Changesets = Vec<(HgChangesetId, RevlogChangeset)>;
type Filelogs =
HashMap<HgNodeKey, Shared<OldBoxFuture<(HgBlobEntry, RepoPath), FailureCompat<Error>>>>;
type ContentBlobs = HashMap<HgNodeKey, ContentBlobInfo>;
type ContentBlobs = HashMap<HgNodeKey, ContentBlobMeta>;
type Manifests = HashMap<HgNodeKey, <TreemanifestEntry as UploadableHgBlob>::Value>;
pub type UploadedBonsais = HashSet<BonsaiChangeset>;
pub type UploadedHgChangesetIds = HashSet<HgChangesetId>;
Expand Down
18 changes: 9 additions & 9 deletions eden/mononoke/repo_client/unbundle/src/upload_changesets.rs
Expand Up @@ -25,7 +25,7 @@ use mercurial_revlog::{
manifest::{Details, ManifestContent},
};
use mercurial_types::{
blobs::{ChangesetMetadata, ContentBlobInfo, HgBlobEntry},
blobs::{ChangesetMetadata, ContentBlobMeta, HgBlobEntry},
HgChangesetId, HgManifestId, HgNodeHash, HgNodeKey, MPath, RepoPath, NULL_HASH,
};
use scuba_ext::ScubaSampleBuilder;
Expand All @@ -34,7 +34,7 @@ use std::ops::AddAssign;
use wirepack::TreemanifestEntry;

type Filelogs = HashMap<HgNodeKey, Shared<OldBoxFuture<(HgBlobEntry, RepoPath), Compat<Error>>>>;
type ContentBlobs = HashMap<HgNodeKey, ContentBlobInfo>;
type ContentBlobs = HashMap<HgNodeKey, ContentBlobMeta>;
type Manifests = HashMap<HgNodeKey, <TreemanifestEntry as UploadableHgBlob>::Value>;
type UploadedChangesets = HashMap<HgChangesetId, ChangesetHandle>;

Expand All @@ -52,7 +52,7 @@ pub struct NewBlobs {
// This is returned as a Vec rather than a Stream so that the path and metadata are
// available before the content blob is uploaded. This will allow creating and uploading
// changeset blobs without being blocked on content blob uploading being complete.
content_blobs: Vec<ContentBlobInfo>,
content_blobs: Vec<ContentBlobMeta>,
}

struct WalkHelperCounters {
Expand Down Expand Up @@ -148,7 +148,7 @@ impl NewBlobs {
manifests: &Manifests,
filelogs: &Filelogs,
content_blobs: &ContentBlobs,
) -> Result<(Vec<HgBlobFuture>, Vec<ContentBlobInfo>, WalkHelperCounters)> {
) -> Result<(Vec<HgBlobFuture>, Vec<ContentBlobMeta>, WalkHelperCounters)> {
if path_taken.len() > 4096 {
bail!(
"Exceeded max manifest path during walking with path: {:?}",
Expand All @@ -157,7 +157,7 @@ impl NewBlobs {
}

let mut entries: Vec<HgBlobFuture> = Vec::new();
let mut cbinfos: Vec<ContentBlobInfo> = Vec::new();
let mut cbmetas: Vec<ContentBlobMeta> = Vec::new();
let mut counters = WalkHelperCounters {
manifests_count: 0,
filelogs_count: 0,
Expand Down Expand Up @@ -197,7 +197,7 @@ impl NewBlobs {
.from_err()
.boxify(),
);
let (mut walked_entries, mut walked_cbinfos, sub_counters) = Self::walk_helper(
let (mut walked_entries, mut walked_cbmetas, sub_counters) = Self::walk_helper(
&key.path,
manifest_content,
get_manifest_parent_content(manifests, key.path.clone(), p1.clone()),
Expand All @@ -207,7 +207,7 @@ impl NewBlobs {
content_blobs,
)?;
entries.append(&mut walked_entries);
cbinfos.append(&mut walked_cbinfos);
cbmetas.append(&mut walked_cbmetas);
counters += sub_counters;
}
} else {
Expand All @@ -226,14 +226,14 @@ impl NewBlobs {
.boxify(),
);
match content_blobs.get(&key) {
Some(cbinfo) => cbinfos.push(cbinfo.clone()),
Some(cbmeta) => cbmetas.push(cbmeta.clone()),
None => bail!("internal error: content blob future missing for filenode"),
}
}
}
}

Ok((entries, cbinfos, counters))
Ok((entries, cbmetas, counters))
}
}

Expand Down

0 comments on commit 34fbac3

Please sign in to comment.