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

Function semantic_replay_scope

atomic-cli/src/commands/git/parallel.rs:445–465  ·  view source on GitHub ↗

The paths whose semantic closure the staged check replays for `parsed`, or `None` for the whole tree. A single-parent commit of an incremental import that excludes nothing changes the closure of exactly the trunks it touches; every other trunk's closure is what the previous import already replayed byte-exact, so only the touched paths (plus every recorded delta path) replay. Merges, exclusions, a

(
    parsed: &ParsedCommit,
    semantic_paths: &[String],
    closure_unchanged: bool,
    incremental: bool,
)

Source from the content-addressed store, hash-verified

443/// exclusions, a fresh import's commits and `ATOMIC_FULL_SEMANTIC_VERIFY=1`
444/// keep the whole-tree replay.
445fn semantic_replay_scope(
446 parsed: &ParsedCommit,
447 semantic_paths: &[String],
448 closure_unchanged: bool,
449 incremental: bool,
450) -> Option<std::collections::BTreeSet<String>> {
451 if parsed.is_merge
452 || !closure_unchanged
453 || !incremental
454 || std::env::var_os("ATOMIC_FULL_SEMANTIC_VERIFY").is_some()
455 {
456 return None;
457 }
458 let mut scope = touched_paths(parsed);
459 scope.extend(
460 semantic_paths
461 .iter()
462 .map(|path| atomic_repository::canonical_path_identity(path)),
463 );
464 Some(scope)
465}
466
467/// Every path a single-parent commit touches: added, modified, deleted,
468/// renamed and copied paths, plus each rename's source.

Callers 1

Calls 4

touched_pathsFunction · 0.85
canonical_path_identityFunction · 0.85
extendMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected