pub struct MutableRepo { /* private fields */ }Implementations§
Source§impl MutableRepo
impl MutableRepo
pub fn new( base_repo: Arc<ReadonlyRepo>, index: Arc<ReadonlyIndex>, view: &View, ) -> MutableRepo
pub fn has_changes(&self) -> bool
pub fn consume(self) -> (MutableIndex, View)
pub fn new_commit( &mut self, settings: &UserSettings, parents: Vec<CommitId>, tree_id: TreeId, ) -> CommitBuilder<'_>
pub fn rewrite_commit( &mut self, settings: &UserSettings, predecessor: &Commit, ) -> CommitBuilder<'_>
pub fn write_commit(&mut self, commit: Commit) -> BackendResult<Commit>
Sourcepub fn record_rewritten_commit(&mut self, old_id: CommitId, new_id: CommitId)
pub fn record_rewritten_commit(&mut self, old_id: CommitId, new_id: CommitId)
Record a commit as having been rewritten in this transaction. This
record is used by rebase_descendants().
Rewritten commits don’t have to be recorded here. This is just a convenient place to record it. It won’t matter after the transaction has been committed.
pub fn clear_rewritten_commits(&mut self)
Sourcepub fn record_abandoned_commit(&mut self, old_id: CommitId)
pub fn record_abandoned_commit(&mut self, old_id: CommitId)
Record a commit as having been abandoned in this transaction. This
record is used by rebase_descendants().
Abandoned commits don’t have to be recorded here. This is just a convenient place to record it. It won’t matter after the transaction has been committed.
pub fn clear_abandoned_commits(&mut self)
pub fn has_rewrites(&self) -> bool
Sourcepub fn create_descendant_rebaser<'settings, 'repo>(
&'repo mut self,
settings: &'settings UserSettings,
) -> DescendantRebaser<'settings, 'repo>
pub fn create_descendant_rebaser<'settings, 'repo>( &'repo mut self, settings: &'settings UserSettings, ) -> DescendantRebaser<'settings, 'repo>
Creates a DescendantRebaser to rebase descendants of the recorded
rewritten and abandoned commits.
pub fn rebase_descendants( &mut self, settings: &UserSettings, ) -> Result<usize, BackendError>
pub fn set_wc_commit( &mut self, workspace_id: WorkspaceId, commit_id: CommitId, ) -> Result<(), RewriteRootCommit>
pub fn remove_wc_commit(&mut self, workspace_id: &WorkspaceId)
pub fn check_out( &mut self, workspace_id: WorkspaceId, settings: &UserSettings, commit: &Commit, ) -> Result<Commit, CheckOutCommitError>
pub fn edit( &mut self, workspace_id: WorkspaceId, commit: &Commit, ) -> Result<(), EditCommitError>
pub fn add_head(&mut self, head: &Commit)
pub fn remove_head(&mut self, head: &CommitId)
pub fn add_public_head(&mut self, head: &Commit)
pub fn remove_public_head(&mut self, head: &CommitId)
pub fn get_branch(&self, name: &str) -> Option<BranchTarget>
pub fn set_branch(&mut self, name: String, target: BranchTarget)
pub fn remove_branch(&mut self, name: &str)
pub fn get_local_branch(&self, name: &str) -> Option<RefTarget>
pub fn set_local_branch(&mut self, name: String, target: RefTarget)
pub fn remove_local_branch(&mut self, name: &str)
pub fn get_remote_branch( &self, name: &str, remote_name: &str, ) -> Option<RefTarget>
pub fn set_remote_branch( &mut self, name: String, remote_name: String, target: RefTarget, )
pub fn remove_remote_branch(&mut self, name: &str, remote_name: &str)
pub fn rename_remote(&mut self, old: &str, new: &str)
pub fn get_tag(&self, name: &str) -> Option<RefTarget>
pub fn set_tag(&mut self, name: String, target: RefTarget)
pub fn remove_tag(&mut self, name: &str)
pub fn get_git_ref(&self, name: &str) -> Option<RefTarget>
pub fn set_git_ref(&mut self, name: String, target: RefTarget)
pub fn remove_git_ref(&mut self, name: &str)
pub fn set_git_head(&mut self, target: RefTarget)
pub fn clear_git_head(&mut self)
pub fn set_view(&mut self, data: View)
pub fn merge(&mut self, base_repo: &ReadonlyRepo, other_repo: &ReadonlyRepo)
pub fn merge_single_ref( &mut self, ref_name: &RefName, base_target: Option<&RefTarget>, other_target: Option<&RefTarget>, )
Trait Implementations§
Source§impl Repo for MutableRepo
impl Repo for MutableRepo
fn base_repo(&self) -> &Arc<ReadonlyRepo> ⓘ
fn store(&self) -> &Arc<Store> ⓘ
fn op_store(&self) -> &Arc<dyn OpStore> ⓘ
fn index(&self) -> &dyn Index
fn view(&self) -> &View
fn resolve_change_id_prefix( &self, prefix: &HexPrefix, ) -> PrefixResolution<Vec<IndexEntry<'_>>>
fn shortest_unique_change_id_prefix_len(&self, target_id: &ChangeId) -> usize
fn resolve_change_id(&self, change_id: &ChangeId) -> Option<Vec<IndexEntry<'_>>>
Auto Trait Implementations§
impl !Freeze for MutableRepo
impl !RefUnwindSafe for MutableRepo
impl !Sync for MutableRepo
impl !UnwindSafe for MutableRepo
impl Send for MutableRepo
impl Unpin for MutableRepo
impl UnsafeUnpin for MutableRepo
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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