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

Method assembly_projected_paths

atomic-repository/src/repository/synthesis.rs:2042–2081  ·  view source on GitHub ↗

Ancestor-directory identity bindings for one assembly: every parent directory of the records being assembled (record paths, move old paths, and deleted paths), resolved through the assembly view's graph closure. Globalization seeds these bindings so structural parent anchoring never depends on the ambient TREE (preserved imports hold TREE updates in the deferred lifecycle journal; the ambient bind

(
        &self,
        txn: &T,
        visibility: &atomic_core::pristine::GraphVisibilityClosure,
        recorded_files: &[atomic_core::record::workflow::RecordedFile],
        deleted_paths: &[S

Source from the content-addressed store, hash-verified

2040 /// the closure stay unseeded — globalization emits their DirAdd anchors
2041 /// inside the change being assembled, exactly as before.
2042 fn assembly_projected_paths<T>(
2043 &self,
2044 txn: &T,
2045 visibility: &atomic_core::pristine::GraphVisibilityClosure,
2046 recorded_files: &[atomic_core::record::workflow::RecordedFile],
2047 deleted_paths: &[String],
2048 ) -> Result<
2049 std::collections::HashMap<String, atomic_core::record::workflow::ProjectedPathBinding>,
2050 RepositoryError,
2051 >
2052 where
2053 T: atomic_core::pristine::GraphTxnT
2054 + atomic_core::pristine::TreeTxnT
2055 + atomic_core::pristine::PathClaimTxnT
2056 + atomic_core::pristine::InodeGraphOps<InodeError = atomic_core::pristine::PristineError>,
2057 {
2058 use atomic_core::record::workflow::ancestor_directories;
2059 use std::collections::{BTreeSet, HashMap};
2060
2061 let mut wanted: BTreeSet<String> = BTreeSet::new();
2062 for file in recorded_files {
2063 wanted.extend(ancestor_directories(file.path()));
2064 if let Some(old_path) = file.old_path() {
2065 wanted.extend(ancestor_directories(old_path));
2066 }
2067 }
2068 for path in deleted_paths {
2069 wanted.extend(ancestor_directories(path));
2070 }
2071
2072 let mut bindings = HashMap::with_capacity(wanted.len());
2073 for directory in wanted {
2074 if let Some(binding) =
2075 self.projected_path_binding_for_visibility(txn, visibility, &directory)?
2076 {
2077 bindings.insert(directory, binding);
2078 }
2079 }
2080 Ok(bindings)
2081 }
2082
2083 /// Git directories are implicit: deleting their last descendant also
2084 /// retires their canonical path claims. Native directory identities stay

Callers 1

Calls 7

ancestor_directoriesFunction · 0.85
extendMethod · 0.80
old_pathMethod · 0.80
pathMethod · 0.45
lenMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected