Struct jj_lib::repo::MutableRepo
source · pub struct MutableRepo { /* private fields */ }
Implementations§
source§impl MutableRepo
impl MutableRepo
pub fn new( base_repo: Arc<ReadonlyRepo>, index: &dyn ReadonlyIndex, view: &View ) -> MutableRepo
pub fn base_repo(&self) -> &Arc<ReadonlyRepo>
pub fn mutable_index(&self) -> &dyn MutableIndex
pub fn has_changes(&self) -> bool
pub fn consume(self) -> (Box<dyn MutableIndex>, View)
pub fn new_commit( &mut self, settings: &UserSettings, parents: Vec<CommitId>, tree_id: MergedTreeId ) -> 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, TreeMergeError>
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 add_heads(&mut self, heads: &[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) -> RefTarget
pub fn set_local_branch_target(&mut self, name: &str, target: RefTarget)
pub fn get_remote_branch(&self, name: &str, remote_name: &str) -> RefTarget
pub fn set_remote_branch_target( &mut self, name: &str, remote_name: &str, target: RefTarget )
pub fn rename_remote(&mut self, old: &str, new: &str)
pub fn get_tag(&self, name: &str) -> RefTarget
pub fn set_tag_target(&mut self, name: &str, target: RefTarget)
pub fn get_git_ref(&self, name: &str) -> RefTarget
pub fn set_git_ref_target(&mut self, name: &str, target: RefTarget)
pub fn git_head(&self) -> RefTarget
pub fn set_git_head_target(&mut self, target: RefTarget)
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: &RefTarget, other_target: &RefTarget )
Trait Implementations§
source§impl Repo for MutableRepo
impl Repo for MutableRepo
fn store(&self) -> &Arc<Store>
fn op_store(&self) -> &Arc<dyn OpStore>
fn index(&self) -> &dyn Index
fn submodule_store(&self) -> &Arc<dyn SubmoduleStore>
fn view(&self) -> &View
fn resolve_change_id_prefix( &self, prefix: &HexPrefix ) -> PrefixResolution<Vec<CommitId>>
fn shortest_unique_change_id_prefix_len(&self, target_id: &ChangeId) -> usize
fn resolve_change_id(&self, change_id: &ChangeId) -> Option<Vec<CommitId>>
Auto Trait Implementations§
impl !RefUnwindSafe for MutableRepo
impl !Send for MutableRepo
impl !Sync for MutableRepo
impl Unpin for MutableRepo
impl !UnwindSafe 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