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

Method cherry_pick

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

2654 /// let result = repo.cherry_pick(&[hash1, hash2], "feature", None)?;
2655 /// ```
2656 pub fn cherry_pick(
2657 &self,
2658 changes: &[Hash],
2659 _from_view: &str,
2660 to_view: Option<&str>,
2661 ) -> Result<CrossViewInsertOutcome, RepositoryError> {
2662 let target = to_view.unwrap_or(&self.current_view);
2663
2664 // For cherry-pick, we insert specific changes with dependencies
2665 let options = CrossViewInsertOptions::new("", target)
2666 .only_changes(changes.to_vec())
2667 .with_dependencies(true);
2668
2669 self.insert_from_view(options)
2670 }
2671
2672 /// Record a Git SHA → Atomic change mapping in the GIT_SHA_INDEX.
2673 ///

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