Struct WorkspaceCommandTransaction

Source
pub struct WorkspaceCommandTransaction<'a> { /* private fields */ }
Expand description

An ongoing Transaction tied to a particular workspace.

WorkspaceCommandTransactions are created with WorkspaceCommandHelper::start_transaction and committed with WorkspaceCommandTransaction::finish. The inner Transaction can also be extracted using WorkspaceCommandTransaction::into_inner in situations where finer-grained control over the Transaction is necessary.

Implementations§

Source§

impl WorkspaceCommandTransaction<'_>

Source

pub fn base_workspace_helper(&self) -> &WorkspaceCommandHelper

Workspace helper that may use the base repo.

Source

pub fn settings(&self) -> &UserSettings

Settings for this workspace.

Source

pub fn base_repo(&self) -> &Arc<ReadonlyRepo>

Source

pub fn repo(&self) -> &MutableRepo

Source

pub fn repo_mut(&mut self) -> &mut MutableRepo

Source

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

Source

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

Source

pub fn format_commit_summary(&self, commit: &Commit) -> String

Source

pub fn write_commit_summary( &self, formatter: &mut dyn Formatter, commit: &Commit, ) -> Result<()>

Source

pub fn commit_summary_template(&self) -> TemplateRenderer<'_, Commit>

Template for one-line summary of a commit within transaction.

Source

pub fn commit_template_language(&self) -> CommitTemplateLanguage<'_>

Creates commit template language environment capturing the current transaction state.

Source

pub fn parse_commit_template( &self, ui: &Ui, template_text: &str, ) -> Result<TemplateRenderer<'_, Commit>, CommandError>

Parses commit template with the current transaction state.

Source

pub fn finish( self, ui: &Ui, description: impl Into<String>, ) -> Result<(), CommandError>

Source

pub fn into_inner(self) -> Transaction

Returns the wrapped Transaction for circumstances where finer-grained control is needed. The caller becomes responsible for finishing the Transaction, including rebasing descendants and updating the working copy, if applicable.

Source

pub fn advance_bookmarks( &mut self, bookmarks: Vec<AdvanceableBookmark>, move_to: &CommitId, )

Moves each bookmark in bookmarks from an old commit it’s associated with (configured by get_advanceable_bookmarks) to the move_to commit. If the bookmark is conflicted before the update, it will remain conflicted after the update, but the conflict will involve the move_to commit instead of the old commit.

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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,