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

Function apply_file_ops

atomic-core/src/apply/file_ops.rs:167–173  ·  view source on GitHub ↗

Apply all FileOps from a change to the CRDT tables. This populates TRUNKS, BRANCHES, and LEAVES tables with the semantic layer data, enabling human-readable diffs and token-level blame. # Arguments `txn` - Mutable transaction for database writes `change_id` - The NodeId of the change being applied `file_ops` - The FileOps to apply # Returns Statistics about what was applied. # Example ```ru

(
    txn: &mut T,
    change_id: NodeId,
    file_ops: &[FileOps],
)

Source from the content-addressed store, hash-verified

165/// let stats = apply_file_ops(&mut txn, change_id, change.file_ops())?;
166/// ```
167pub fn apply_file_ops<T: MutTxnT>(
168 txn: &mut T,
169 change_id: NodeId,
170 file_ops: &[FileOps],
171) -> PristineResult<ApplyFileOpsStats> {
172 apply_file_ops_with_inodes(txn, change_id, file_ops, &HashMap::new())
173}
174
175fn apply_file_ops_with_inodes<T: MutTxnT>(
176 txn: &mut T,

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected