pub struct MergeService { /* private fields */ }Expand description
Merge service for handling workspace merges
Implementations§
Source§impl MergeService
impl MergeService
Sourcepub async fn find_common_ancestor(
&self,
source_workspace_id: Uuid,
target_workspace_id: Uuid,
) -> Result<Option<Uuid>>
pub async fn find_common_ancestor( &self, source_workspace_id: Uuid, target_workspace_id: Uuid, ) -> Result<Option<Uuid>>
Find the common ancestor commit between two workspaces
This uses a simple approach: find the fork point if one exists, otherwise find the earliest common commit in both histories.
Sourcepub async fn merge_workspaces(
&self,
source_workspace_id: Uuid,
target_workspace_id: Uuid,
user_id: Uuid,
) -> Result<(Value, Vec<MergeConflict>)>
pub async fn merge_workspaces( &self, source_workspace_id: Uuid, target_workspace_id: Uuid, user_id: Uuid, ) -> Result<(Value, Vec<MergeConflict>)>
Perform a three-way merge between two workspaces
Merges changes from source_workspace into target_workspace. Returns the merged state and any conflicts.
Sourcepub async fn complete_merge(
&self,
merge_id: Uuid,
user_id: Uuid,
resolved_state: Value,
message: String,
) -> Result<Uuid>
pub async fn complete_merge( &self, merge_id: Uuid, user_id: Uuid, resolved_state: Value, message: String, ) -> Result<Uuid>
Complete a merge by creating a merge commit
Sourcepub async fn get_merge(&self, merge_id: Uuid) -> Result<WorkspaceMerge>
pub async fn get_merge(&self, merge_id: Uuid) -> Result<WorkspaceMerge>
Get a merge by ID
Sourcepub async fn list_merges(
&self,
workspace_id: Uuid,
) -> Result<Vec<WorkspaceMerge>>
pub async fn list_merges( &self, workspace_id: Uuid, ) -> Result<Vec<WorkspaceMerge>>
List merges for a workspace
Auto Trait Implementations§
impl Freeze for MergeService
impl !RefUnwindSafe for MergeService
impl Send for MergeService
impl Sync for MergeService
impl Unpin for MergeService
impl !UnwindSafe for MergeService
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
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>
Converts
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>
Converts
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