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