Merger

Struct Merger 

Source
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

Source

pub fn new<T: PyTree>( branch: &dyn PyBranch, this_tree: &T, revision_graph: &Graph, ) -> Self

Create a new merger for merging into a tree.

§Arguments
  • branch - The branch to merge from
  • this_tree - The tree to merge into
  • revision_graph - The graph of revisions to use for finding common ancestors
§Returns

A new Merger object

Source

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

Source

pub fn set_other_revision( &mut self, other_revision: &RevisionId, other_branch: &dyn PyBranch, ) -> Result<(), Error>

Set the other revision to merge.

§Arguments
  • other_revision - The revision ID to merge
  • other_branch - The branch containing the revision
§Returns

Ok(()) on success, or an error if the operation fails

Source

pub fn set_base_revision( &mut self, base_revision: &RevisionId, base_branch: &dyn PyBranch, ) -> Result<(), Error>

Set the base revision for the merge.

§Arguments
  • base_revision - The base revision ID to use
  • base_branch - The branch containing the base revision
§Returns

Ok(()) on success, or an error if the operation fails

Source

pub fn set_merge_type(&mut self, merge_type: MergeType)

Set the merge algorithm to use.

§Arguments
  • merge_type - The merge algorithm to use
Source

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

Source

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 from
  • other_branch - The branch containing the revision to merge
  • other - The revision ID to merge
  • tree_branch - The branch containing the tree to merge into
§Returns

A new Merger object, or an error if the operation fails

Trait Implementations§

Source§

impl From<Py<PyAny>> for Merger

Source§

fn from(obj: Py<PyAny>) -> Self

Converts to this type from the input type.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Ungil for T
where T: Send,