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

Method cherry_pick

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

2709 /// let result = repo.cherry_pick(&[hash1, hash2], "feature", None)?;
2710 /// ```
2711 pub fn cherry_pick(
2712 &self,
2713 changes: &[Hash],
2714 _from_view: &str,
2715 to_view: Option<&str>,
2716 ) -> Result<CrossViewInsertOutcome, RepositoryError> {
2717 let target = to_view.unwrap_or(&self.current_view);
2718
2719 // For cherry-pick, we insert specific changes with dependencies
2720 let options = CrossViewInsertOptions::new("", target)
2721 .only_changes(changes.to_vec())
2722 .with_dependencies(true);
2723
2724 self.insert_from_view(options)
2725 }
2726
2727 /// Record a Git SHA → Atomic change mapping in the GIT_SHA_INDEX.
2728 ///

Callers 1

run_change_insertFunction · 0.80

Calls 3

only_changesMethod · 0.80
insert_from_viewMethod · 0.80
with_dependenciesMethod · 0.45

Tested by

no test coverage detected