pub struct MergedTreeBuilder { /* private fields */ }
Expand description
Helper for writing trees with conflicts.
You start by creating an instance of this type with one or more base trees. You then add overrides on top. The overrides may be conflicts. Then you can write the result as a legacy tree (allowing path-level conflicts) or as multiple conflict-free trees.
Implementations§
Source§impl MergedTreeBuilder
impl MergedTreeBuilder
Sourcepub fn new(base_tree_id: MergedTreeId) -> Self
pub fn new(base_tree_id: MergedTreeId) -> Self
Create a new builder with the given trees as base.
Sourcepub fn set_or_remove(&mut self, path: RepoPathBuf, values: MergedTreeValue)
pub fn set_or_remove(&mut self, path: RepoPathBuf, values: MergedTreeValue)
Set an override compared to the base tree. The values
merge must
either be resolved (i.e. have 1 side) or have the same number of
sides as the base_tree_ids
used to construct this builder. Use
Merge::absent()
to remove a value from the tree. When the base tree is
a legacy tree, conflicts can be written either as a multi-way Merge
value or as a resolved Merge
value using TreeValue::Conflict
.
Sourcepub fn write_tree(self, store: &Arc<Store>) -> BackendResult<MergedTreeId>
pub fn write_tree(self, store: &Arc<Store>) -> BackendResult<MergedTreeId>
Create new tree(s) from the base tree(s) and overrides.
Auto Trait Implementations§
impl Freeze for MergedTreeBuilder
impl RefUnwindSafe for MergedTreeBuilder
impl Send for MergedTreeBuilder
impl Sync for MergedTreeBuilder
impl Unpin for MergedTreeBuilder
impl UnwindSafe for MergedTreeBuilder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more