`atomic insert ` over InsertChanges — the raw reference rides the single-ref arm (the handler resolves it with the local resolver's semantics); both --deps forms (the escape hatch rides apply_dependencies). Rendered with the local single-insert body's exact print functions.
(
change: &str,
view: Option<String>,
allow_conflicts: bool,
deps: bool,
)
| 4063 | /// apply_dependencies). Rendered with the local single-insert body's |
| 4064 | /// exact print functions. |
| 4065 | pub fn insert_single( |
| 4066 | change: &str, |
| 4067 | view: Option<String>, |
| 4068 | allow_conflicts: bool, |
| 4069 | deps: bool, |
| 4070 | ) -> CliResult<bool> { |
| 4071 | let Some(session) = Service::open()? else { |
| 4072 | return Ok(false); |
| 4073 | }; |
| 4074 | let request = insert_request( |
| 4075 | &session, |
| 4076 | Some(pb::insert_changes_request::Source::SingleRef( |
| 4077 | change.to_string(), |
| 4078 | )), |
| 4079 | view, |
| 4080 | allow_conflicts, |
| 4081 | deps, |
| 4082 | false, |
| 4083 | ); |
| 4084 | let response = insert_rpc(&session, request)?; |
| 4085 | let hash = response |
| 4086 | .resolved_change |
| 4087 | .as_ref() |
| 4088 | .and_then(|h| h.value.clone().try_into().ok()) |
| 4089 | .map(Merkle); |
| 4090 | if let Some(hash) = hash { |
| 4091 | print_info(&format!( |
| 4092 | "Inserting change {}...", |
| 4093 | crate::commands::format_hash(&hash, true) |
| 4094 | )); |
| 4095 | } |
| 4096 | let applied = insert_applied_hashes(&response); |
| 4097 | let new_state = response |
| 4098 | .new_state |
| 4099 | .as_ref() |
| 4100 | .and_then(|h| h.value.clone().try_into().ok()) |
| 4101 | .map(Merkle) |
| 4102 | .unwrap_or_default(); |
| 4103 | super::insert::print_insert_outcome(&applied, new_state, response.has_conflicts); |
| 4104 | if let Some(review) = insert_review_approval(&response) { |
| 4105 | super::insert::print_review_approval(&review); |
| 4106 | } |
| 4107 | print_insert_refresh(&response, false); |
| 4108 | Ok(true) |
| 4109 | } |
| 4110 | |
| 4111 | /// `atomic insert view <source> [--to <target>] [-n]` over InsertChanges — |
| 4112 | /// both --deps forms and the dry-run preview (the handler computes the |
no test coverage detected