pub struct Merger(/* private fields */);Expand description
Represents a merge operation between two branches.
This struct provides methods to configure and perform merges between branches, including finding the base revision, setting merge parameters, and executing the merge.
Implementations§
Source§impl Merger
impl Merger
Sourcepub fn new<T: PyTree>(
branch: &dyn PyBranch,
this_tree: &T,
revision_graph: &Graph,
) -> Self
pub fn new<T: PyTree>( branch: &dyn PyBranch, this_tree: &T, revision_graph: &Graph, ) -> Self
Sourcepub fn find_base(&self) -> Result<Option<RevisionId>, Error>
pub fn find_base(&self) -> Result<Option<RevisionId>, Error>
Find the base revision for the merge.
§Returns
The base revision ID if found, or None if the branches are unrelated
Sourcepub fn set_other_revision(
&mut self,
other_revision: &RevisionId,
other_branch: &dyn PyBranch,
) -> Result<(), Error>
pub fn set_other_revision( &mut self, other_revision: &RevisionId, other_branch: &dyn PyBranch, ) -> Result<(), Error>
Sourcepub fn set_base_revision(
&mut self,
base_revision: &RevisionId,
base_branch: &dyn PyBranch,
) -> Result<(), Error>
pub fn set_base_revision( &mut self, base_revision: &RevisionId, base_branch: &dyn PyBranch, ) -> Result<(), Error>
Sourcepub fn set_merge_type(&mut self, merge_type: MergeType)
pub fn set_merge_type(&mut self, merge_type: MergeType)
Sourcepub fn make_merger(&self) -> Result<Submerger, Error>
pub fn make_merger(&self) -> Result<Submerger, Error>
Create a submerger to execute the merge.
§Returns
A Submerger object that can perform the actual merge
Sourcepub fn from_revision_ids<T: PyTree>(
other_tree: &T,
other_branch: &dyn PyBranch,
other: &RevisionId,
tree_branch: &dyn PyBranch,
) -> Result<Self, Error>
pub fn from_revision_ids<T: PyTree>( other_tree: &T, other_branch: &dyn PyBranch, other: &RevisionId, tree_branch: &dyn PyBranch, ) -> Result<Self, Error>
Create a merger from specific revision IDs.
§Arguments
other_tree- The tree to merge fromother_branch- The branch containing the revision to mergeother- The revision ID to mergetree_branch- The branch containing the tree to merge into
§Returns
A new Merger object, or an error if the operation fails
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Merger
impl !RefUnwindSafe for Merger
impl Send for Merger
impl Sync for Merger
impl Unpin for Merger
impl UnwindSafe for Merger
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more