pub struct JjVcs;Trait Implementations§
Source§impl Vcs for JjVcs
impl Vcs for JjVcs
Source§fn ensure_commit(&self, repo: &Path, refspec_or_sha: &str) -> Result<()>
fn ensure_commit(&self, repo: &Path, refspec_or_sha: &str) -> Result<()>
Fetch
refspec_or_sha into the canonical repo if not already present.Source§fn add_workspace(
&self,
repo: &Path,
ws: &Path,
checkout: &Checkout,
name: &str,
version: &str,
) -> Result<String>
fn add_workspace( &self, repo: &Path, ws: &Path, checkout: &Checkout, name: &str, version: &str, ) -> Result<String>
Create a new worktree/workspace at
ws from the canonical repo, applying checkout.
name is the review’s key slug (e.g. moz/D12345), used to namespace the ref that pins
this version so it survives future updates; see update_workspace. Returns the
resulting head id.Source§fn update_workspace(
&self,
repo: &Path,
ws: &Path,
checkout: &Checkout,
name: &str,
version: &str,
) -> Result<String>
fn update_workspace( &self, repo: &Path, ws: &Path, checkout: &Checkout, name: &str, version: &str, ) -> Result<String>
Re-point an existing, clean workspace at a new
checkout/version. The commit the
workspace pointed at before this call remains reachable afterwards (each call pins its
own resulting head under a name/version-namespaced ref rather than overwriting the
previous one), so old versions stay available for interdiffing until remove_workspace
drops them all. Returns the new head id.Source§fn is_dirty(&self, ws: &Path, expected_head: &str) -> Result<bool>
fn is_dirty(&self, ws: &Path, expected_head: &str) -> Result<bool>
True if the workspace has local modifications, or its head isn’t
expected_head (the
stack tip) or one of its ancestors - either case means sync must not touch it silently.
Sitting on an earlier patch of the stack (see position) is not dirty.Source§fn position(&self, ws: &Path, commit: &str) -> Result<()>
fn position(&self, ws: &Path, commit: &str) -> Result<()>
Move a clean workspace to
commit, one of the patches reachable from the stack tip. Never
rewrites any of the stack’s commits, so the tip stays valid for is_dirty.Source§fn commits(
&self,
ws: &Path,
tip: &str,
limit: usize,
) -> Result<Vec<(String, String)>>
fn commits( &self, ws: &Path, tip: &str, limit: usize, ) -> Result<Vec<(String, String)>>
Up to
limit commits reachable from tip (newest first) as (commit id, message), so a
caller can find the one carrying a particular review’s patch.Source§fn remove_workspace(&self, repo: &Path, ws: &Path, name: &str) -> Result<()>
fn remove_workspace(&self, repo: &Path, ws: &Path, name: &str) -> Result<()>
Remove the worktree/workspace and every ref/bookmark
add_workspace/update_workspace
pinned for it under name. Callers only ever call this on a workspace is_dirty has
already confirmed is clean - there’s no way to force-remove a dirty one.Auto Trait Implementations§
impl Freeze for JjVcs
impl RefUnwindSafe for JjVcs
impl Send for JjVcs
impl Sync for JjVcs
impl Unpin for JjVcs
impl UnsafeUnpin for JjVcs
impl UnwindSafe for JjVcs
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