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

Function change_depends_on

atomic-repository/src/repository/deferred_tree.rs:150–172  ·  view source on GitHub ↗
(txn: &T, change: Hash, ancestor: Hash)

Source from the content-addressed store, hash-verified

148}
149
150fn change_depends_on<T: GraphTxnT>(txn: &T, change: Hash, ancestor: Hash) -> bool {
151 if change == ancestor {
152 return false;
153 }
154 let mut pending = vec![change];
155 let mut visited = HashSet::new();
156 while let Some(hash) = pending.pop() {
157 if !visited.insert(hash) {
158 continue;
159 }
160 let Ok(Some(id)) = txn.get_internal(&hash) else {
161 continue;
162 };
163 let Ok(deps) = txn.get_change_deps(id) else {
164 continue;
165 };
166 if deps.contains(&ancestor) {
167 return true;
168 }
169 pending.extend(deps);
170 }
171 false
172}
173
174fn external_inode_position<T: GraphTxnT + TreeTxnT>(
175 txn: &T,

Callers 1

Calls 5

extendMethod · 0.80
insertMethod · 0.45
get_internalMethod · 0.45
get_change_depsMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected