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

Function context_vertex

atomic-core/src/apply/insertion.rs:312–323  ·  view source on GitHub ↗

The context vertex at `pos`: one written earlier in this change, else the inode-scoped lookup (`is_predecessor` selects the end-of-span or start-of-span reading of `pos`).

(
    txn: &CachedWriteGraphTxn<'_, '_>,
    workspace: &Workspace,
    inode: Option<Inode>,
    pos: Position<NodeId>,
    is_predecessor: bool,
)

Source from the content-addressed store, hash-verified

310/// the inode-scoped lookup (`is_predecessor` selects the end-of-span or
311/// start-of-span reading of `pos`).
312fn context_vertex(
313 txn: &CachedWriteGraphTxn<'_, '_>,
314 workspace: &Workspace,
315 inode: Option<Inode>,
316 pos: Position<NodeId>,
317 is_predecessor: bool,
318) -> Result<GraphNode<NodeId>, LocalApplyError> {
319 match workspace.get_current_vertex(pos, is_predecessor) {
320 Some(vertex) => Ok(vertex),
321 None => resolve_context_vertex_in_inode(txn, inode, pos, is_predecessor),
322 }
323}
324
325/// Resolve a context position through the file's own vertex index first.
326///

Callers 1

Calls 2

get_current_vertexMethod · 0.80

Tested by

no test coverage detected