MutableRepo

Struct MutableRepo 

Source
pub struct MutableRepo { /* private fields */ }

Implementations§

Source§

impl MutableRepo

Source

pub fn new( base_repo: Arc<ReadonlyRepo>, index: Arc<ReadonlyIndex>, view: &View, ) -> MutableRepo

Source

pub fn has_changes(&self) -> bool

Source

pub fn consume(self) -> (MutableIndex, View)

Source

pub fn new_commit( &mut self, settings: &UserSettings, parents: Vec<CommitId>, tree_id: TreeId, ) -> CommitBuilder<'_>

Source

pub fn rewrite_commit( &mut self, settings: &UserSettings, predecessor: &Commit, ) -> CommitBuilder<'_>

Source

pub fn write_commit(&mut self, commit: Commit) -> BackendResult<Commit>

Source

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.

Source

pub fn clear_rewritten_commits(&mut self)

Source

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.

Source

pub fn clear_abandoned_commits(&mut self)

Source

pub fn has_rewrites(&self) -> bool

Source

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.

Source

pub fn rebase_descendants( &mut self, settings: &UserSettings, ) -> Result<usize, BackendError>

Source

pub fn set_wc_commit( &mut self, workspace_id: WorkspaceId, commit_id: CommitId, ) -> Result<(), RewriteRootCommit>

Source

pub fn remove_wc_commit(&mut self, workspace_id: &WorkspaceId)

Source

pub fn check_out( &mut self, workspace_id: WorkspaceId, settings: &UserSettings, commit: &Commit, ) -> Result<Commit, CheckOutCommitError>

Source

pub fn edit( &mut self, workspace_id: WorkspaceId, commit: &Commit, ) -> Result<(), EditCommitError>

Source

pub fn add_head(&mut self, head: &Commit)

Source

pub fn remove_head(&mut self, head: &CommitId)

Source

pub fn add_public_head(&mut self, head: &Commit)

Source

pub fn remove_public_head(&mut self, head: &CommitId)

Source

pub fn get_branch(&self, name: &str) -> Option<BranchTarget>

Source

pub fn set_branch(&mut self, name: String, target: BranchTarget)

Source

pub fn remove_branch(&mut self, name: &str)

Source

pub fn get_local_branch(&self, name: &str) -> Option<RefTarget>

Source

pub fn set_local_branch(&mut self, name: String, target: RefTarget)

Source

pub fn remove_local_branch(&mut self, name: &str)

Source

pub fn get_remote_branch( &self, name: &str, remote_name: &str, ) -> Option<RefTarget>

Source

pub fn set_remote_branch( &mut self, name: String, remote_name: String, target: RefTarget, )

Source

pub fn remove_remote_branch(&mut self, name: &str, remote_name: &str)

Source

pub fn rename_remote(&mut self, old: &str, new: &str)

Source

pub fn get_tag(&self, name: &str) -> Option<RefTarget>

Source

pub fn set_tag(&mut self, name: String, target: RefTarget)

Source

pub fn remove_tag(&mut self, name: &str)

Source

pub fn get_git_ref(&self, name: &str) -> Option<RefTarget>

Source

pub fn set_git_ref(&mut self, name: String, target: RefTarget)

Source

pub fn remove_git_ref(&mut self, name: &str)

Source

pub fn set_git_head(&mut self, target: RefTarget)

Source

pub fn clear_git_head(&mut self)

Source

pub fn set_view(&mut self, data: View)

Source

pub fn merge(&mut self, base_repo: &ReadonlyRepo, other_repo: &ReadonlyRepo)

Source

pub fn merge_single_ref( &mut self, ref_name: &RefName, base_target: Option<&RefTarget>, other_target: Option<&RefTarget>, )

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,