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 rebase_descendants_return_map( &mut self, settings: &UserSettings ) -> Result<HashMap<CommitId, CommitId>, 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)
sourcepub fn has_branch(&self, name: &str) -> bool
pub fn has_branch(&self, name: &str) -> bool
Returns true if any local or remote branch of the given name
exists.
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 merge_local_branch( &mut self, name: &str, base_target: &RefTarget, other_target: &RefTarget )
pub fn get_remote_branch(&self, name: &str, remote_name: &str) -> RemoteRef
pub fn set_remote_branch( &mut self, name: &str, remote_name: &str, remote_ref: RemoteRef )
sourcepub fn track_remote_branch(&mut self, name: &str, remote_name: &str)
pub fn track_remote_branch(&mut self, name: &str, remote_name: &str)
Merges the specified remote branch in to local branch, and starts tracking it.
sourcepub fn untrack_remote_branch(&mut self, name: &str, remote_name: &str)
pub fn untrack_remote_branch(&mut self, name: &str, remote_name: &str)
Stops tracking the specified remote branch.