pub struct Workspace { /* private fields */ }
Expand description
The combination of a repo and a working copy.
Represents the combination of a repo and working copy, i.e. what’s typically the .jj/ directory and its parent. See https://github.com/jj-vcs/jj/blob/main/docs/working-copy.md#workspaces for more information.
Implementations§
Source§impl Workspace
impl Workspace
pub fn new( workspace_root: &Path, repo_path: PathBuf, working_copy: Box<dyn WorkingCopy>, repo_loader: RepoLoader, ) -> Result<Workspace, PathError>
pub fn new_no_canonicalize( workspace_root: PathBuf, repo_path: PathBuf, working_copy: Box<dyn WorkingCopy>, repo_loader: RepoLoader, ) -> Self
pub fn init_simple( user_settings: &UserSettings, workspace_root: &Path, ) -> Result<(Self, Arc<ReadonlyRepo>), WorkspaceInitError>
Sourcepub fn init_internal_git(
user_settings: &UserSettings,
workspace_root: &Path,
) -> Result<(Self, Arc<ReadonlyRepo>), WorkspaceInitError>
pub fn init_internal_git( user_settings: &UserSettings, workspace_root: &Path, ) -> Result<(Self, Arc<ReadonlyRepo>), WorkspaceInitError>
Initializes a workspace with a new Git backend and bare Git repo in
.jj/repo/store/git
.
Sourcepub fn init_colocated_git(
user_settings: &UserSettings,
workspace_root: &Path,
) -> Result<(Self, Arc<ReadonlyRepo>), WorkspaceInitError>
pub fn init_colocated_git( user_settings: &UserSettings, workspace_root: &Path, ) -> Result<(Self, Arc<ReadonlyRepo>), WorkspaceInitError>
Initializes a workspace with a new Git backend and Git repo that shares the same working copy.
Sourcepub fn init_external_git(
user_settings: &UserSettings,
workspace_root: &Path,
git_repo_path: &Path,
) -> Result<(Self, Arc<ReadonlyRepo>), WorkspaceInitError>
pub fn init_external_git( user_settings: &UserSettings, workspace_root: &Path, git_repo_path: &Path, ) -> Result<(Self, Arc<ReadonlyRepo>), WorkspaceInitError>
Initializes a workspace with an existing Git repo at the specified path.
The git_repo_path
usually ends with .git
. It’s the path to the Git
repo directory, not the working directory.
pub fn init_with_factories( user_settings: &UserSettings, workspace_root: &Path, backend_initializer: &BackendInitializer<'_>, signer: Signer, op_store_initializer: &OpStoreInitializer<'_>, op_heads_store_initializer: &OpHeadsStoreInitializer<'_>, index_store_initializer: &IndexStoreInitializer<'_>, submodule_store_initializer: &SubmoduleStoreInitializer<'_>, working_copy_factory: &dyn WorkingCopyFactory, workspace_name: WorkspaceNameBuf, ) -> Result<(Self, Arc<ReadonlyRepo>), WorkspaceInitError>
pub fn init_with_backend( user_settings: &UserSettings, workspace_root: &Path, backend_initializer: &BackendInitializer<'_>, signer: Signer, ) -> Result<(Self, Arc<ReadonlyRepo>), WorkspaceInitError>
pub fn init_workspace_with_existing_repo( workspace_root: &Path, repo_path: &Path, repo: &Arc<ReadonlyRepo>, working_copy_factory: &dyn WorkingCopyFactory, workspace_name: WorkspaceNameBuf, ) -> Result<(Self, Arc<ReadonlyRepo>), WorkspaceInitError>
pub fn load( user_settings: &UserSettings, workspace_path: &Path, store_factories: &StoreFactories, working_copy_factories: &WorkingCopyFactories, ) -> Result<Self, WorkspaceLoadError>
pub fn workspace_root(&self) -> &Path
pub fn workspace_name(&self) -> &WorkspaceName
pub fn repo_path(&self) -> &Path
pub fn repo_loader(&self) -> &RepoLoader
Sourcepub fn settings(&self) -> &UserSettings
pub fn settings(&self) -> &UserSettings
Settings for this workspace.
pub fn working_copy(&self) -> &dyn WorkingCopy
pub fn start_working_copy_mutation( &mut self, ) -> Result<LockedWorkspace<'_>, WorkingCopyStateError>
pub fn check_out( &mut self, operation_id: OperationId, old_tree_id: Option<&MergedTreeId>, commit: &Commit, options: &CheckoutOptions, ) -> Result<CheckoutStats, CheckoutError>
Auto Trait Implementations§
impl Freeze for Workspace
impl !RefUnwindSafe for Workspace
impl Send for Workspace
impl !Sync for Workspace
impl Unpin for Workspace
impl !UnwindSafe for Workspace
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
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>
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 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>
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