mononoke: add create_repo_unredatected to the args helper

Summary:
We need this to accomodate `blobimport`'s needs of using (opening(D16914875)
and creating(this)) unredacted repos.

Note: this is nearly identical to D16914875.

Reviewed By: StanislavGlebik

Differential Revision: D16915557

fbshipit-source-id: 6b522e6fcee4582870df27cf66e8ad55e91235fe
This commit is contained in:
Kostia Balytskyi 2019-08-20 06:18:38 -07:00 committed by Facebook Github Bot
parent 83065085fd
commit 496749e2a7
2 changed files with 18 additions and 1 deletions

View File

@ -316,6 +316,23 @@ pub fn create_repo<'a>(
)
}
/// Create a new `BlobRepo` -- for local instances, expect its contents to be empty.
/// Make sure that the opened repo has redaction disabled
#[inline]
pub fn create_repo_unredacted<'a>(
logger: &Logger,
matches: &ArgMatches<'a>,
) -> impl Future<Item = BlobRepo, Error = Error> {
open_repo_internal(
logger,
matches,
true,
parse_caching(matches),
Scrubbing::Disabled,
Some(Redaction::Disabled),
)
}
/// Open an existing `BlobRepo` -- for local instances, expect contents to already be there.
#[inline]
pub fn open_repo<'a>(

View File

@ -95,7 +95,7 @@ fn main() -> Result<()> {
let blobrepo = if matches.is_present("no-create") {
args::open_repo_unredacted(&ctx.logger(), &matches).left_future()
} else {
args::create_repo(&ctx.logger(), &matches).right_future()
args::create_repo_unredacted(&ctx.logger(), &matches).right_future()
};
let blobimport = blobrepo