MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / raw_dependencies

Function raw_dependencies

atomic-repository/src/repository/name_resolution.rs:1055–1071  ·  view source on GitHub ↗

The RAW dependency rows of `change`, as internal ids. Not the indexed accessor: legacy repositories predate the dependency index, and the indexed read fails closed on them (dev #196/#206 parity, exercised by the unrecord-safety legacy fixtures). Raw rows return empty for unindexed changes, matching dev's fallback semantics for this supersession probe.

(txn: &T, change: NodeId)

Source from the content-addressed store, hash-verified

1053/// unindexed changes, matching dev's fallback semantics for this
1054/// supersession probe.
1055fn raw_dependencies<T: GraphTxnT>(txn: &T, change: NodeId) -> Result<Vec<NodeId>, RepositoryError> {
1056 txn.get_change_deps(change)
1057 .map_err(|error| RepositoryError::Database(error.to_string()))?
1058 .into_iter()
1059 .map(|dependency| {
1060 txn.get_internal(&dependency)
1061 .map_err(|error| RepositoryError::Database(error.to_string()))?
1062 .ok_or_else(|| {
1063 RepositoryError::Database(format!(
1064 "change {} has unregistered dependency {}",
1065 change.get(),
1066 dependency
1067 ))
1068 })
1069 })
1070 .collect()
1071}
1072
1073#[cfg(test)]
1074mod tests {

Callers 1

change_depends_onFunction · 0.85

Calls 4

collectMethod · 0.45
into_iterMethod · 0.45
get_change_depsMethod · 0.45
get_internalMethod · 0.45

Tested by

no test coverage detected