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

Method cherry_pick

atomic-repository/src/repository/insert.rs:2561–2575  ·  view source on GitHub ↗

Cherry-pick specific changes from one view into another. # Arguments `changes` - Hashes of changes to insert `from_view` - Source view (for validation) `to_view` - Target view (None = current view) # Returns A `CrossViewInsertOutcome` with details about what was inserted. # Example ```rust,ignore let result = repo.cherry_pick(&[hash1, hash2], "feature", None)?; ```

(
        &self,
        changes: &[Hash],
        _from_view: &str,
        to_view: Option<&str>,
    )

Source from the content-addressed store, hash-verified

2559 /// let result = repo.cherry_pick(&[hash1, hash2], "feature", None)?;
2560 /// ```
2561 pub fn cherry_pick(
2562 &self,
2563 changes: &[Hash],
2564 _from_view: &str,
2565 to_view: Option<&str>,
2566 ) -> Result<CrossViewInsertOutcome, RepositoryError> {
2567 let target = to_view.unwrap_or(&self.current_view);
2568
2569 // For cherry-pick, we insert specific changes with dependencies
2570 let options = CrossViewInsertOptions::new("", target)
2571 .only_changes(changes.to_vec())
2572 .with_dependencies(true);
2573
2574 self.insert_from_view(options)
2575 }
2576
2577 /// Record a Git SHA → Atomic change mapping in the GIT_SHA_INDEX.
2578 ///

Callers 1

run_pickFunction · 0.80

Calls 3

only_changesMethod · 0.80
insert_from_viewMethod · 0.80
with_dependenciesMethod · 0.45

Tested by

no test coverage detected