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

Method side_changes

atomic-repository/src/repository/conflict_object.rs:345–367  ·  view source on GitHub ↗

Every side change hash referenced by any entry, deduplicated and ordered. A pack is complete only when every referenced change exists in the receiving store.

(&self)

Source from the content-addressed store, hash-verified

343 /// ordered. A pack is complete only when every referenced change exists
344 /// in the receiving store.
345 pub fn side_changes(&self) -> Vec<Hash> {
346 let mut changes = Vec::new();
347 for file in &self.files {
348 for entry in &file.entries {
349 if let Some(base) = &entry.base {
350 if !changes.contains(&base.change) {
351 changes.push(base.change);
352 }
353 }
354 for side in &entry.sides {
355 if !changes.contains(&side.change) {
356 changes.push(side.change);
357 }
358 }
359 for claimant in &entry.claimants {
360 if !changes.contains(&claimant.change) {
361 changes.push(claimant.change);
362 }
363 }
364 }
365 }
366 changes
367 }
368
369 /// Structural self-check: every entry must name at least one side or
370 /// claimant, and every file must have entries.

Callers 1

Calls 2

containsMethod · 0.45
pushMethod · 0.45

Tested by 1