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

Method cherry_pick

atomic-repository/src/repository/insert.rs:3666–3680  ·  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

3664 /// let result = repo.cherry_pick(&[hash1, hash2], "feature", None)?;
3665 /// ```
3666 pub fn cherry_pick(
3667 &self,
3668 changes: &[Hash],
3669 _from_view: &str,
3670 to_view: Option<&str>,
3671 ) -> Result<CrossViewInsertOutcome, RepositoryError> {
3672 let target = to_view.unwrap_or(&self.current_view);
3673
3674 // For cherry-pick, we insert specific changes with dependencies
3675 let options = CrossViewInsertOptions::new("", target)
3676 .only_changes(changes.to_vec())
3677 .with_dependencies(true);
3678
3679 self.insert_from_view(options)
3680 }
3681
3682 /// Record a Git SHA → Atomic change mapping in the GIT_SHA_INDEX.
3683 ///

Callers 2

run_change_insertFunction · 0.80
insert_changesMethod · 0.80

Calls 3

only_changesMethod · 0.80
insert_from_viewMethod · 0.80
with_dependenciesMethod · 0.45

Tested by

no test coverage detected