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],
)
| 164 | /// let stats = apply_file_ops(&mut txn, change_id, change.file_ops())?; |
| 165 | /// ``` |
| 166 | pub fn apply_file_ops<T: MutTxnT>( |
| 167 | txn: &mut T, |
| 168 | change_id: NodeId, |
| 169 | file_ops: &[FileOps], |
| 170 | ) -> PristineResult<ApplyFileOpsStats> { |
| 171 | let mut stats = ApplyFileOpsStats::new(); |
| 172 | let mut next_leaf_idx = 0u32; |
| 173 | for ops in file_ops { |
| 174 | apply_single_file_ops(txn, change_id, ops, &mut stats, &mut next_leaf_idx)?; |
| 175 | } |
| 176 | Ok(stats) |
| 177 | } |
| 178 | |
| 179 | /// Apply FileOps using CRDT table handles opened once for the full pass. |
| 180 | /// |
no test coverage detected