Struct jj_cli::cli_util::WorkspaceCommandHelper
source · pub struct WorkspaceCommandHelper { /* private fields */ }Implementations§
source§impl WorkspaceCommandHelper
impl WorkspaceCommandHelper
pub fn new( ui: &mut Ui, command: &CommandHelper, workspace: Workspace, repo: Arc<ReadonlyRepo> ) -> Result<Self, CommandError>
pub fn git_backend(&self) -> Option<&GitBackend>
pub fn check_working_copy_writable(&self) -> Result<(), CommandError>
sourcepub fn snapshot(&mut self, ui: &mut Ui) -> Result<(), CommandError>
pub fn snapshot(&mut self, ui: &mut Ui) -> Result<(), CommandError>
Snapshot the working copy if allowed, and import Git refs if the working copy is collocated with Git.
pub fn repo(&self) -> &Arc<ReadonlyRepo>
pub fn working_copy(&self) -> &dyn WorkingCopy
pub fn unchecked_start_working_copy_mutation( &mut self ) -> Result<(LockedWorkspace<'_>, Commit), CommandError>
pub fn start_working_copy_mutation( &mut self ) -> Result<(LockedWorkspace<'_>, Commit), CommandError>
pub fn workspace_root(&self) -> &PathBuf
pub fn workspace_id(&self) -> &WorkspaceId
pub fn get_wc_commit_id(&self) -> Option<&CommitId>
pub fn format_file_path(&self, file: &RepoPath) -> String
sourcepub fn parse_file_path(&self, input: &str) -> Result<RepoPath, FsPathParseError>
pub fn parse_file_path(&self, input: &str) -> Result<RepoPath, FsPathParseError>
Parses a path relative to cwd into a RepoPath, which is relative to the workspace root.
pub fn matcher_from_values( &self, values: &[String] ) -> Result<Box<dyn Matcher>, CommandError>
pub fn git_config(&self) -> Result<Config, Error>
pub fn base_ignores(&self) -> Arc<GitIgnoreFile>
pub fn resolve_single_op(&self, op_str: &str) -> Result<Operation, CommandError>
sourcepub fn resolve_single_rev(
&self,
revision_str: &str,
ui: &mut Ui
) -> Result<Commit, CommandError>
pub fn resolve_single_rev( &self, revision_str: &str, ui: &mut Ui ) -> Result<Commit, CommandError>
Resolve a revset to a single revision. Return an error if the revset is empty or has multiple revisions.
sourcepub fn resolve_revset(
&self,
revision_str: &str,
ui: &mut Ui
) -> Result<Vec<Commit>, CommandError>
pub fn resolve_revset( &self, revision_str: &str, ui: &mut Ui ) -> Result<Vec<Commit>, CommandError>
Resolve a revset any number of revisions (including 0).
sourcepub fn resolve_revset_default_single(
&self,
revision_str: &str,
ui: &mut Ui
) -> Result<Vec<Commit>, CommandError>
pub fn resolve_revset_default_single( &self, revision_str: &str, ui: &mut Ui ) -> Result<Vec<Commit>, CommandError>
Resolve a revset any number of revisions (including 0), but require the
user to indicate if they allow multiple revisions by prefixing the
expression with all:.
pub fn parse_revset( &self, revision_str: &str, ui: Option<&mut Ui> ) -> Result<Rc<RevsetExpression>, RevsetParseError>
pub fn evaluate_revset<'repo>( &'repo self, revset_expression: Rc<RevsetExpression> ) -> Result<Box<dyn Revset<'repo> + 'repo>, CommandError>
pub fn id_prefix_context(&self) -> Result<&IdPrefixContext, CommandError>
pub fn template_aliases_map(&self) -> &TemplateAliasesMap
pub fn parse_commit_template( &self, template_text: &str ) -> Result<Box<dyn Template<Commit> + '_>, CommandError>
sourcepub fn format_commit_summary(&self, commit: &Commit) -> String
pub fn format_commit_summary(&self, commit: &Commit) -> String
Returns one-line summary of the given commit.
sourcepub fn write_commit_summary(
&self,
formatter: &mut dyn Formatter,
commit: &Commit
) -> Result<()>
pub fn write_commit_summary( &self, formatter: &mut dyn Formatter, commit: &Commit ) -> Result<()>
Writes one-line summary of the given commit.
pub fn check_rewritable<'a>( &self, commits: impl IntoIterator<Item = &'a Commit> ) -> Result<(), CommandError>
pub fn check_non_empty(&self, commits: &[Commit]) -> Result<(), CommandError>
pub fn snapshot_working_copy(&mut self, ui: &mut Ui) -> Result<(), CommandError>
pub fn start_transaction( &mut self, description: &str ) -> WorkspaceCommandTransaction<'_>
Auto Trait Implementations§
impl !RefUnwindSafe for WorkspaceCommandHelper
impl !Send for WorkspaceCommandHelper
impl !Sync for WorkspaceCommandHelper
impl Unpin for WorkspaceCommandHelper
impl !UnwindSafe for WorkspaceCommandHelper
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