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

Function delete_all_content

atomic-core/src/record/workflow/globalize/hunk.rs:579–593  ·  view source on GitHub ↗

Build an [`EdgeUpdate`] that marks every content vertex in the file as deleted. This is the single place where "find all content vertices → create deletion edges" happens. Both [`globalize_replace_whole_file`] and [`globalize_delete`] delegate here. Uses [`find_content_vertices_global`] — the full SCC-aware traversal via `retrieve_graph`, the same one used for display/diffing — rather than a lin

(
    ctx: &mut GlobalizeContext<'_, T>,
    inode_pos: Position<NodeId>,
)

Source from the content-addressed store, hash-verified

577/// whole-file replace, or a full-file delete), so the extra cost is an
578/// acceptable trade for actually being complete.
579fn delete_all_content<T>(
580 ctx: &mut GlobalizeContext<'_, T>,
581 inode_pos: Position<NodeId>,
582) -> GlobalizeResult<EdgeUpdate<Option<Hash>>>
583where
584 T: GraphTxnT + TreeTxnT + InodeGraphOps,
585{
586 let content_vertices = find_content_vertices_global(ctx.txn(), inode_pos)?;
587 let deletion_edges = build_deletion_edges(ctx, &content_vertices)?;
588
589 Ok(EdgeUpdate {
590 edges: deletion_edges,
591 inode: position_to_option_hash_resolved(ctx.txn(), inode_pos, None),
592 })
593}
594
595// ───────────────────────────────────────────────────────────────────────────
596// Insert position classification

Callers 2

globalize_deleteFunction · 0.85

Calls 4

build_deletion_edgesFunction · 0.85
txnMethod · 0.45

Tested by

no test coverage detected