pub struct JjVcs { /* private fields */ }Implementations§
Trait Implementations§
Source§impl Vcs for JjVcs
impl Vcs for JjVcs
Source§fn read_jj_view(&self, log_limit: usize) -> Result<Option<JjView>, VcsError>
fn read_jj_view(&self, log_limit: usize) -> Result<Option<JjView>, VcsError>
Change ids cover twice log_limit, since jj and git order a busy
history differently.
Source§fn status(&self) -> Result<StatusModel, VcsError>
fn status(&self) -> Result<StatusModel, VcsError>
One diff pass of @- vs the working copy. jj marks a new file
intent-to-add in the index, so git’s three lists would count it twice.
Source§fn resolve(&self, revision: &str) -> Result<String, VcsError>
fn resolve(&self, revision: &str) -> Result<String, VcsError>
Git syntax (main~2, refs, oids, HEAD as @-) resolves through
git, since a colocated repo’s git refs are current where jj’s import
of them may lag. With no .git the store’s refs are stale or absent,
so jj’s bookmarks name the commit there, and git applies the
ancestry suffix. What git cannot read (trunk(), change ids) is a jj
revset; a git suffix never goes to jj, which reads ~ as a set
difference.
Source§fn branches(&self) -> Result<Vec<BranchInfo>, VcsError>
fn branches(&self) -> Result<Vec<BranchInfo>, VcsError>
A repo with no .git lists jj’s local bookmarks; the one @ sits on
or under counts as checked out.
Source§fn divergence(&self, branch: &str) -> Result<Option<(usize, usize)>, VcsError>
fn divergence(&self, branch: &str) -> Result<Option<(usize, usize)>, VcsError>
A repo with no .git measures a bookmark against its first remote
namesake.
Source§fn pull_target(&self) -> Result<Option<PullTarget>, VcsError>
fn pull_target(&self) -> Result<Option<PullTarget>, VcsError>
origin wins when the bookmark tracks several remotes.
Source§fn commit(&self, message: &str) -> Result<String, VcsError>
fn commit(&self, message: &str) -> Result<String, VcsError>
Messages go as --message=<text>: clap reads a separate value that
starts with - as a flag.
Source§fn amend(
&self,
message: Option<&str>,
use_index: bool,
) -> Result<String, VcsError>
fn amend( &self, message: Option<&str>, use_index: bool, ) -> Result<String, VcsError>
None squashes with -u, since a bare squash opens an editor when
both sides are described. Some without use_index rewords @- alone.
Source§fn create_branch(&self, name: &str, _checkout: bool) -> Result<(), VcsError>
fn create_branch(&self, name: &str, _checkout: bool) -> Result<(), VcsError>
Bookmarks @; checkout is moot since @ is already checked out.
Source§fn delete_branch(&self, name: &str) -> Result<(), VcsError>
fn delete_branch(&self, name: &str) -> Result<(), VcsError>
exact:, since jj reads a bare name as a glob.
Source§fn checkout(&self, name: &str) -> Result<(), VcsError>
fn checkout(&self, name: &str) -> Result<(), VcsError>
jj new <rev> works on top of the branch and keeps the change left
behind; jj edit would rewrite the tip in place.
Source§fn network_argv(&self, op: NetworkOp) -> Result<Vec<String>, VcsError>
fn network_argv(&self, op: NetworkOp) -> Result<Vec<String>, VcsError>
A push sends what JjVcs::push_selection picks, and jj tracks the
remote bookmark it makes. A pull is the fetch alone;
Vcs::rebase_onto_remote follows it.
Source§fn has_index(&self) -> bool
fn has_index(&self) -> bool
StatusModel::staged.Source§fn native_git_checkout(&self) -> bool
fn native_git_checkout(&self) -> bool
git/forge CLI command may check out a branch. False for
jj, whose operation log would miss the write, so we go through
Vcs::checkout there.Source§fn git_dir(&self) -> Result<PathBuf, VcsError>
fn git_dir(&self) -> Result<PathBuf, VcsError>
.git file points at.fn head(&self) -> Result<HeadInfo, VcsError>
Source§fn adopt_jj_view(&self, view: JjView)
fn adopt_jj_view(&self, view: JjView)
Source§fn working_tree_diff(&self) -> Result<DiffModel, VcsError>
fn working_tree_diff(&self) -> Result<DiffModel, VcsError>
Source§fn tree_to_workdir_diff(&self, base_oid: &str) -> Result<DiffModel, VcsError>
fn tree_to_workdir_diff(&self, base_oid: &str) -> Result<DiffModel, VcsError>
Vcs::working_tree_diff taken from base_oid.Source§fn commit_diff(&self, oid: &str) -> Result<DiffModel, VcsError>
fn commit_diff(&self, oid: &str) -> Result<DiffModel, VcsError>
Source§fn range_diff(
&self,
oldest_oid: &str,
newest_oid: &str,
) -> Result<DiffModel, VcsError>
fn range_diff( &self, oldest_oid: &str, newest_oid: &str, ) -> Result<DiffModel, VcsError>
git diff <oldest>^..<newest>. A root oldest diffs from the empty
tree.Source§fn tree_diff(
&self,
base_oid: &str,
newest_oid: &str,
) -> Result<DiffModel, VcsError>
fn tree_diff( &self, base_oid: &str, newest_oid: &str, ) -> Result<DiffModel, VcsError>
git diff <base> <newest>; with base a merge base this is a
three-dot diff.fn merge_base(&self, a: &str, b: &str) -> Result<String, VcsError>
Source§fn log(
&self,
limit: usize,
all_branches: bool,
) -> Result<Vec<LogEntry>, VcsError>
fn log( &self, limit: usize, all_branches: bool, ) -> Result<Vec<LogEntry>, VcsError>
all_branches, newest first and each commit before its parents.Source§fn default_branch(&self, remote: &str) -> Result<Option<String>, VcsError>
fn default_branch(&self, remote: &str) -> Result<Option<String>, VcsError>
Source§fn commits_between(
&self,
base: &str,
head: &str,
) -> Result<Vec<LogEntry>, VcsError>
fn commits_between( &self, base: &str, head: &str, ) -> Result<Vec<LogEntry>, VcsError>
head but not base, newest first.Source§fn unpushed(&self, limit: usize) -> Result<Option<Vec<LogEntry>>, VcsError>
fn unpushed(&self, limit: usize) -> Result<Option<Vec<LogEntry>>, VcsError>
limit. None when the repo has no remote-tracking refs. We
ask the remotes since a configured upstream may be a local branch or a
stale ref.Source§fn blame(&self, rel: &Path) -> Result<Vec<BlameSpan>, VcsError>
fn blame(&self, rel: &Path) -> Result<Vec<BlameSpan>, VcsError>
rel as the worktree has it, in line
order. Uncommitted lines come back as spans owned by no commit.Source§fn read_at(&self, rev: &str, path: &str) -> Result<Option<String>, VcsError>
fn read_at(&self, rev: &str, path: &str) -> Result<Option<String>, VcsError>
rev’s tree, None when the tree lacks it.Source§fn read_blob(&self, oid: &str) -> Result<Option<Vec<u8>>, VcsError>
fn read_blob(&self, oid: &str) -> Result<Option<Vec<u8>>, VcsError>
crate::model::BlobIds side),
None when the object store has no such blob.Source§fn tracked_files(&self) -> Result<Vec<PathBuf>, VcsError>
fn tracked_files(&self) -> Result<Vec<PathBuf>, VcsError>
Source§fn attr(&self, rel: &Path, name: &str) -> bool
fn attr(&self, rel: &Path, name: &str) -> bool
name to true for rel.
Unreadable attribute files read as unset.Source§fn all_branches(&self) -> Result<Vec<String>, VcsError>
fn all_branches(&self) -> Result<Vec<String>, VcsError>
Source§fn stage(&self, _rel: &Path) -> Result<(), VcsError>
fn stage(&self, _rel: &Path) -> Result<(), VcsError>
Source§fn stage_everything(&self) -> Result<(), VcsError>
fn stage_everything(&self) -> Result<(), VcsError>
Source§fn unstage_everything(&self) -> Result<(), VcsError>
fn unstage_everything(&self) -> Result<(), VcsError>
Source§fn stage_hunk(&self, _rel: &Path, _hunk: &HunkId) -> Result<(), VcsError>
fn stage_hunk(&self, _rel: &Path, _hunk: &HunkId) -> Result<(), VcsError>
Source§fn unstage(&self, _rel: &Path) -> Result<(), VcsError>
fn unstage(&self, _rel: &Path) -> Result<(), VcsError>
Source§fn unstage_hunk(&self, _rel: &Path, _hunk: &HunkId) -> Result<(), VcsError>
fn unstage_hunk(&self, _rel: &Path, _hunk: &HunkId) -> Result<(), VcsError>
Source§fn discard(&self, rel: &Path) -> Result<(), VcsError>
fn discard(&self, rel: &Path) -> Result<(), VcsError>
Source§fn commit_paths(
&self,
message: &str,
paths: &[String],
) -> Result<String, VcsError>
fn commit_paths( &self, message: &str, paths: &[String], ) -> Result<String, VcsError>
paths (files or folders) of the working copy, which jj
can do with no index; returns the new commit id.Source§fn rebase_onto_remote(
&self,
bookmark: &str,
remote: &str,
) -> Result<PullOutcome, VcsError>
fn rebase_onto_remote( &self, bookmark: &str, remote: &str, ) -> Result<PullOutcome, VcsError>
@’s branch onto bookmark@remote when that
moved.Source§fn commit_message(&self, oid: &str) -> Result<String, VcsError>
fn commit_message(&self, oid: &str) -> Result<String, VcsError>
oid.Source§fn head_message(&self) -> Result<String, VcsError>
fn head_message(&self) -> Result<String, VcsError>
Source§fn stash_push(&self, _message: Option<&str>) -> Result<(), VcsError>
fn stash_push(&self, _message: Option<&str>) -> Result<(), VcsError>
git stash. message None lets the backend label it.