pub struct WorkspaceCommandTransaction<'a> { /* private fields */ }
Expand description
An ongoing Transaction
tied to a particular workspace.
WorkspaceCommandTransaction
s 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<'_>
impl WorkspaceCommandTransaction<'_>
Sourcepub fn base_workspace_helper(&self) -> &WorkspaceCommandHelper
pub fn base_workspace_helper(&self) -> &WorkspaceCommandHelper
Workspace helper that may use the base repo.
Sourcepub fn settings(&self) -> &UserSettings
pub fn settings(&self) -> &UserSettings
Settings for this workspace.
pub fn base_repo(&self) -> &Arc<ReadonlyRepo>
pub fn repo(&self) -> &MutableRepo
pub fn repo_mut(&mut self) -> &mut MutableRepo
pub fn check_out( &mut self, commit: &Commit, ) -> Result<Commit, CheckOutCommitError>
pub fn edit(&mut self, commit: &Commit) -> Result<(), EditCommitError>
pub fn format_commit_summary(&self, commit: &Commit) -> String
pub fn write_commit_summary( &self, formatter: &mut dyn Formatter, commit: &Commit, ) -> Result<()>
Sourcepub fn commit_summary_template(&self) -> TemplateRenderer<'_, Commit>
pub fn commit_summary_template(&self) -> TemplateRenderer<'_, Commit>
Template for one-line summary of a commit within transaction.
Sourcepub fn commit_template_language(&self) -> CommitTemplateLanguage<'_>
pub fn commit_template_language(&self) -> CommitTemplateLanguage<'_>
Creates commit template language environment capturing the current transaction state.
Sourcepub fn parse_commit_template(
&self,
ui: &Ui,
template_text: &str,
) -> Result<TemplateRenderer<'_, Commit>, CommandError>
pub fn parse_commit_template( &self, ui: &Ui, template_text: &str, ) -> Result<TemplateRenderer<'_, Commit>, CommandError>
Parses commit template with the current transaction state.
pub fn finish( self, ui: &Ui, description: impl Into<String>, ) -> Result<(), CommandError>
Sourcepub fn into_inner(self) -> Transaction
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.
Sourcepub fn advance_bookmarks(
&mut self,
bookmarks: Vec<AdvanceableBookmark>,
move_to: &CommitId,
)
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§
impl<'a> !Freeze for WorkspaceCommandTransaction<'a>
impl<'a> !RefUnwindSafe for WorkspaceCommandTransaction<'a>
impl<'a> !Send for WorkspaceCommandTransaction<'a>
impl<'a> !Sync for WorkspaceCommandTransaction<'a>
impl<'a> Unpin for WorkspaceCommandTransaction<'a>
impl<'a> !UnwindSafe for WorkspaceCommandTransaction<'a>
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
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>
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>
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