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

Method depends_on

atomic-repository/src/repository/dependency_closure.rs:30–42  ·  view source on GitHub ↗

Whether `descendant` is `ancestor` or transitively depends on it. `dependencies` lists a change's direct dependencies.

(
        &mut self,
        descendant: K,
        ancestor: K,
        dependencies: &mut impl FnMut(K) -> Result<Vec<K>, E>,
    )

Source from the content-addressed store, hash-verified

28 /// Whether `descendant` is `ancestor` or transitively depends on it.
29 /// `dependencies` lists a change's direct dependencies.
30 pub(crate) fn depends_on<E>(
31 &mut self,
32 descendant: K,
33 ancestor: K,
34 dependencies: &mut impl FnMut(K) -> Result<Vec<K>, E>,
35 ) -> Result<bool, E> {
36 if descendant == ancestor {
37 return Ok(true);
38 }
39 Ok(self
40 .ancestors_of(descendant, dependencies)?
41 .contains(&ancestor))
42 }
43
44 /// The transitive dependency set of `change`, computed once. The walk is
45 /// iterative, so a long linear history cannot overflow the stack, and a

Callers 2

change_depends_onFunction · 0.45
change_depends_onFunction · 0.45

Calls 2

ancestors_ofMethod · 0.80
containsMethod · 0.45

Tested by

no test coverage detected