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

Function write_change_to_graph

atomic-repository/src/apply/mod.rs:233–252  ·  view source on GitHub ↗

Write a change to the graph and add it to a view's change log. This function handles two cases: 1. **New change**: The change hasn't been applied to the graph yet. We apply all hunks and add it to the view's change log. 2. **Existing change**: The change is already in the graph (applied via another view). We skip hunk application and just add it to the view's change log. This distinction is cruc

(
    txn: &mut WriteTxn<'_>,
    view_name: &str,
    change_id: NodeId,
    change_hash: &Hash,
    change: &Change,
    options: &InsertOptions,
    already_in_graph: bool,
)

Source from the content-addressed store, hash-verified

231///
232/// The result of the insertion including new state and conflict info.
233pub fn write_change_to_graph(
234 txn: &mut WriteTxn<'_>,
235 view_name: &str,
236 change_id: NodeId,
237 change_hash: &Hash,
238 change: &Change,
239 options: &InsertOptions,
240 already_in_graph: bool,
241) -> InsertResult<InsertOutcome> {
242 reject_unsupported_span_change(change)?;
243 write_change_to_graph_inner(
244 txn,
245 view_name,
246 change_id,
247 change_hash,
248 change,
249 options,
250 already_in_graph,
251 )
252}
253
254// The caller must either index the span operations in this transaction or
255// have proved the existing ambient index before a reference-only insertion.

Calls 2

Tested by

no test coverage detected