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

Function change_union

atomic-cli/src/commands/clone/helpers.rs:464–475  ·  view source on GitHub ↗

The union of change hashes across a set of manifests. Changes are content-addressed and shared across views (a draft's log includes its inherited prefix), so the union is deduplicated: each hash appears once, at its first occurrence. Iterating manifests root→leaf therefore yields parents' changes before children's own suffixes.

(manifests: &[ViewManifest])

Source from the content-addressed store, hash-verified

462/// appears once, at its first occurrence. Iterating manifests root→leaf
463/// therefore yields parents' changes before children's own suffixes.
464pub fn change_union(manifests: &[ViewManifest]) -> Vec<Hash> {
465 let mut seen: HashSet<Hash> = HashSet::new();
466 let mut union = Vec::new();
467 for manifest in manifests {
468 for hash in &manifest.changes {
469 if seen.insert(*hash) {
470 union.push(*hash);
471 }
472 }
473 }
474 union
475}
476
477// Inventory Support Detection
478

Callers 3

run_asyncMethod · 0.85

Calls 2

insertMethod · 0.45
pushMethod · 0.45