mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 16:31:02 +03:00
edenapi: update hash-to-location to discard unknown hashes
Summary: The hashes that are passed in as parameters to the hash-to-location function may not be hashes that actually exist. This change updates the code so that we don't return an error when an unknown hash is passed in. The unknown hash will be skipped in the list of results. Reviewed By: quark-zju Differential Revision: D27526758 fbshipit-source-id: 8bf9b7a134a6a8a4f78fa0df276f847d922472f5
This commit is contained in:
parent
d64c9b479d
commit
5f78ccb284
@ -185,17 +185,13 @@ impl HgRepoContext {
|
||||
})
|
||||
.collect::<Result<Vec<_>, MononokeError>>()?;
|
||||
|
||||
// We should treat hg_ids as being absolutely any hash. It is perfectly valid for the
|
||||
// server to have not encountered the hash that it was given to convert. Filter out the
|
||||
// hashes that we could not convert to bonsai.
|
||||
let cs_ids = hg_ids
|
||||
.iter()
|
||||
.map(|hg_id| {
|
||||
hg_to_bonsai.get(hg_id).cloned().ok_or_else(|| {
|
||||
MononokeError::InvalidRequest(format!(
|
||||
"failed to find bonsaid equivalent for {}",
|
||||
hg_id
|
||||
))
|
||||
})
|
||||
})
|
||||
.collect::<Result<Vec<ChangesetId>, MononokeError>>()?;
|
||||
.filter_map(|hg_id| hg_to_bonsai.get(hg_id).cloned())
|
||||
.collect::<Vec<ChangesetId>>();
|
||||
|
||||
let cs_to_blocations = self
|
||||
.repo()
|
||||
|
@ -73,7 +73,8 @@ Create and send file data request.
|
||||
> "$B",
|
||||
> "$A",
|
||||
> "$F",
|
||||
> "$H"
|
||||
> "$H",
|
||||
> "000000000000000000000000000000123456789a"
|
||||
> ]
|
||||
> }
|
||||
> EOF
|
||||
@ -90,6 +91,7 @@ Create and send file data request.
|
||||
WireHgId("426bada5c67598ca65036d57d9e4b64b0c1ce7a0"),
|
||||
WireHgId("bb56d4161ee371c720dbc8b504810c62a22fe314"),
|
||||
WireHgId("06383dd46c9bcbca9300252b4b6cddad88f8af21"),
|
||||
WireHgId("000000000000000000000000000000123456789a"),
|
||||
],
|
||||
master_heads: [
|
||||
WireHgId("1b794c59b583e47686701d0142848e90a3a94a7d"),
|
||||
|
Loading…
Reference in New Issue
Block a user