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

Function insert_changes

atomic-cli/src/commands/rpc.rs:4158–4187  ·  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

4156/// call the local body makes). Rendered with the local multi-insert
4157/// body's exact print functions.
4158pub fn insert_changes(
4159 changes: &[String],
4160 target: Option<String>,
4161 allow_conflicts: bool,
4162) -> CliResult<bool> {
4163 let Some(session) = Service::open()? else {
4164 return Ok(false);
4165 };
4166 let set = pb::ChangeSet {
4167 changes: changes.to_vec(),
4168 };
4169 let request = insert_request(
4170 &session,
4171 Some(pb::insert_changes_request::Source::ChangeSet(set)),
4172 target,
4173 allow_conflicts,
4174 true,
4175 false,
4176 );
4177 let response = insert_rpc(&session, request)?;
4178 let resolved_target = response.resolved_target_view.clone().unwrap_or_default();
4179 print_info(&format!(
4180 "Cherry-picking {} change(s) to '{resolved_target}'...",
4181 changes.len()
4182 ));
4183 let outcome = insert_cross_view_outcome(&response);
4184 super::insert::print_cross_view_outcome(&outcome, false);
4185 print_insert_refresh(&response, false);
4186 Ok(true)
4187}
4188
4189/// The bare `atomic insert` promotion over InsertChanges — the promote
4190/// arm resolves the current view, its parent, and the missing set

Callers 1

runMethod · 0.85

Calls 8

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

Tested by

no test coverage detected