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

Function insert_changes

atomic-cli/src/commands/rpc.rs:4195–4224  ·  view source on GitHub ↗

`atomic insert change ...` (multi-pick) over InsertChanges — every reference rides the change-set arm raw (the handler resolves each with the local resolver's semantics and applies them with the cherry-pick call the local body makes). Rendered with the local multi-insert body's exact print functions.

(
    changes: &[String],
    target: Option<String>,
    allow_conflicts: bool,
)

Source from the content-addressed store, hash-verified

4193/// call the local body makes). Rendered with the local multi-insert
4194/// body's exact print functions.
4195pub fn insert_changes(
4196 changes: &[String],
4197 target: Option<String>,
4198 allow_conflicts: bool,
4199) -> CliResult<bool> {
4200 let Some(session) = Service::open()? else {
4201 return Ok(false);
4202 };
4203 let set = pb::ChangeSet {
4204 changes: changes.to_vec(),
4205 };
4206 let request = insert_request(
4207 &session,
4208 Some(pb::insert_changes_request::Source::ChangeSet(set)),
4209 target,
4210 allow_conflicts,
4211 true,
4212 false,
4213 );
4214 let response = insert_rpc(&session, request)?;
4215 let resolved_target = response.resolved_target_view.clone().unwrap_or_default();
4216 print_info(&format!(
4217 "Cherry-picking {} change(s) to '{resolved_target}'...",
4218 changes.len()
4219 ));
4220 let outcome = insert_cross_view_outcome(&response);
4221 super::insert::print_cross_view_outcome(&outcome, false);
4222 print_insert_refresh(&response, false);
4223 Ok(true)
4224}
4225
4226/// The bare `atomic insert` promotion over InsertChanges — the promote
4227/// arm resolves the current view, its parent, and the missing set

Callers 1

runMethod · 0.85

Calls 8

insert_requestFunction · 0.85
insert_rpcFunction · 0.85
print_infoFunction · 0.85
print_cross_view_outcomeFunction · 0.85
print_insert_refreshFunction · 0.85
openFunction · 0.50
cloneMethod · 0.45

Tested by

no test coverage detected