Skip to main content

Jj

Struct Jj 

Source
pub struct Jj<R: ProcessRunner = JobRunner> { /* private fields */ }
Expand description

The real jj client. Generic over the ProcessRunner so tests can inject a fake process executor; Jj::new() uses the real job-backed runner.

Implementations§

Source§

impl Jj<JobRunner>

Source

pub fn new() -> Self

Create a client driving the real job-backed runner.

Source§

impl<R: ProcessRunner> Jj<R>

Source

pub fn with_runner(runner: R) -> Self

Create a client driving runner — inject a fake in tests.

Source

pub fn default_timeout(self, timeout: Duration) -> Self

Apply a default timeout to every command this client builds.

Source

pub fn default_env( self, key: impl AsRef<OsStr>, value: impl AsRef<OsStr>, ) -> Self

Set an environment variable on every command this client builds (e.g. GIT_TERMINAL_PROMPT=0).

Source

pub fn default_env_remove(self, key: impl AsRef<OsStr>) -> Self

Remove an inherited environment variable on every command this client builds.

Source§

impl<R: ProcessRunner> Jj<R>

Source

pub fn default_cancel_on(self, token: CancellationToken) -> Self

Cancel every command this client builds when token fires (a per-command cancel_on replaces the default — see CliClient::default_cancel_on).

Source§

impl<R: ProcessRunner> Jj<R>

Source

pub async fn run_args(&self, args: &[&str]) -> Result<String>

Run jj <args> over string slices — jj.run_args(&["log", "-r", "@"]) without allocating a Vec<String>. Inherent (not on the object-safe trait), so it can take &[&str]; forwards to the same path as JjApi::run.

Source

pub async fn workspace_roots( &self, dir: &Path, names: &[String], ) -> Vec<Result<PathBuf>>

Resolve several workspaces’ root paths in one bounded fan-out — one jj workspace root --name <n> per name, at most WORKSPACE_ROOTS_CONCURRENCY (8) live at a time — instead of awaiting each in turn. Per-name Ok/Err mirrors workspace_root (a non-zero exit or spawn failure → Err); results come back in names order. Runs through this client’s own runner, so a ScriptedRunner test drives it hermetically. Inherent (not on the object-safe trait): it’s a throughput shape over the trait method, and the batch primitive isn’t a mockable per-call seam.

Source

pub async fn run_raw_args(&self, args: &[&str]) -> Result<ProcessResult<String>>

Like run_args but never errors on a non-zero exit (mirrors JjApi::run_raw).

Source

pub fn at<'a>(&'a self, dir: &'a Path) -> JjAt<'a, R>

Bind this client to dir, returning a JjAt handle whose methods omit the dir argument: jj.at(dir).status() runs status against dir. The dir-taking JjApi methods stay on Jj for driving many directories (e.g. workspaces) from one client.

Source

pub async fn transaction<'a, T, F, Fut>( &'a self, dir: &'a Path, f: F, ) -> Result<T>
where F: FnOnce(JjAt<'a, R>) -> Fut, Fut: Future<Output = Result<T>> + 'a,

Run a mutation sequence with op-log rollback: capture the current operation (op_head), run f with a JjAt bound to dir, and on Err restore the repo to the captured operation (op_restore) before returning the error.

jj.transaction(std::path::Path::new("."), |tx| async move {
    tx.describe("wip").await?;
    tx.new_change("next").await // an Err here rolls back the describe
})
.await?;

Inherent (not on the object-safe trait): the closure parameter is generic, which mockall / trait objects can’t express.

Caveats:

  • Rollback runs on Err only — not on panic or cancellation (a dropped future); there is no async Drop. Convert panics to Err inside f if you need that safety.
  • If the restore itself fails, the original error from f is returned and the repo may be left mid-transaction; re-probe op_head to detect that.

Trait Implementations§

Source§

impl Default for Jj<JobRunner>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<R: ProcessRunner> JjApi for Jj<R>

Source§

fn run<'life0, 'life1, 'async_trait>( &'life0 self, args: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Run jj <args>, returning trimmed stdout (throws on a non-zero exit).
Source§

fn run_raw<'life0, 'life1, 'async_trait>( &'life0 self, args: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<ProcessResult<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Like JjApi::run but never errors on a non-zero exit — returns the captured ProcessResult.
Source§

fn version<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Installed Jujutsu version (jj --version).
Source§

fn capabilities<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<JjCapabilities>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The installed binary’s parsed version, as JjCapabilities (jj --version). A value type — probe once and keep it; an unrecognisable version string is an Error::Parse.
Source§

fn status<'life0, 'life1, 'async_trait>( &'life0 self, dir: &'life1 Path, ) -> Pin<Box<dyn Future<Output = Result<Vec<ChangedPath>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Parsed working-copy changes — the files changed in @ (jj diff -r @ --summary), mirroring vcs_git status.
Source§

fn status_text<'life0, 'life1, 'async_trait>( &'life0 self, dir: &'life1 Path, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Raw jj status text (human-readable) — the unparsed counterpart of status, mirroring vcs_git status_text.
Source§

fn log<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, revset: &'life2 str, max: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Change>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Changes matching revset, newest first, up to max (jj log).
Source§

fn current_change<'life0, 'life1, 'async_trait>( &'life0 self, dir: &'life1 Path, ) -> Pin<Box<dyn Future<Output = Result<Change>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The working-copy change (jj log -r @).
Source§

fn describe<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, message: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Set the working-copy change’s description (jj describe -m).
Source§

fn describe_rev<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, dir: &'life1 Path, revset: &'life2 str, message: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Set the description of an arbitrary revision (jj describe -r <revset> -m).
Source§

fn new_change<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, message: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Start a new change on top of the working copy (jj new -m).
Source§

fn bookmarks<'life0, 'life1, 'async_trait>( &'life0 self, dir: &'life1 Path, ) -> Pin<Box<dyn Future<Output = Result<Vec<Bookmark>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Local bookmarks (jj bookmark list).
Source§

fn bookmarks_all<'life0, 'life1, 'async_trait>( &'life0 self, dir: &'life1 Path, ) -> Pin<Box<dyn Future<Output = Result<Vec<BookmarkRef>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Local and remote-tracking bookmarks (jj bookmark list -a).
Source§

fn reachable_bookmarks<'life0, 'life1, 'async_trait>( &'life0 self, dir: &'life1 Path, ) -> Pin<Box<dyn Future<Output = Result<Vec<Bookmark>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Local bookmarks on the nearest commits reachable from @ (log -r 'heads(::@ & bookmarks())') — the candidate targets a commit “belongs to”. A commit carrying several bookmarks yields one entry each.
Source§

fn bookmark_track<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, dir: &'life1 Path, name: &'life2 str, remote: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Track a remote bookmark (jj bookmark track <name>@<remote>).
Source§

fn bookmark_set<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, dir: &'life1 Path, name: &'life2 str, revision: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Point a bookmark at revision (jj bookmark set <name> -r <revision>).
Source§

fn git_fetch<'life0, 'life1, 'async_trait>( &'life0 self, dir: &'life1 Path, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch from the git remote (jj git fetch); transient (network) failures are retried (3 attempts, 500 ms backoff).
Source§

fn git_fetch_from<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, remote: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fetch from a named git remote (jj git fetch --remote <remote>); transient failures are retried like git_fetch.
Source§

fn git_push<'life0, 'life1, 'async_trait>( &'life0 self, dir: &'life1 Path, bookmark: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Push to the git remote (jj git push, optionally -b <bookmark>). The bookmark is owned (Option<String>) to keep the trait mockall-friendly.
Source§

fn root<'life0, 'life1, 'async_trait>( &'life0 self, dir: &'life1 Path, ) -> Pin<Box<dyn Future<Output = Result<PathBuf>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Working-copy root of the current workspace (jj root).
Source§

fn current_bookmark<'life0, 'life1, 'async_trait>( &'life0 self, dir: &'life1 Path, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The local bookmark on the working-copy change @, if exactly one (or the first of several); None when @ carries no bookmark. ws enforces the one-bookmark policy on top.
Source§

fn trunk<'life0, 'life1, 'async_trait>( &'life0 self, dir: &'life1 Path, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The trunk bookmark (jj log -r 'trunk()'); None when unresolved.
Source§

fn bookmark_create<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, dir: &'life1 Path, name: &'life2 str, revision: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Create a bookmark at a revision (bookmark create <name> -r <rev>).
Source§

fn bookmark_rename<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, dir: &'life1 Path, old: &'life2 str, new: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Rename a bookmark (bookmark rename <old> <new>).
Source§

fn bookmark_delete<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, name: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Delete a bookmark (bookmark delete <name>).
Source§

fn bookmark_move<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, dir: &'life1 Path, name: &'life2 str, to: &'life3 str, allow_backwards: bool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Move a bookmark to a revision (bookmark move <name> --to <rev> [--allow-backwards]).
Source§

fn diff_summary<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, dir: &'life1 Path, from: &'life2 str, to: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<ChangedPath>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Per-file change summary for a range (diff -r <from>..<to> --summary).
Source§

fn diff_stat<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, revset: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<DiffStat>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Aggregate change stats for a revset (diff -r <revset> --stat).
Source§

fn diff_text<'life0, 'life1, 'async_trait>( &'life0 self, dir: &'life1 Path, spec: DiffSpec, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Raw git-format unified diff text for spec (diff -r <spec> --git) — stable machine output.
Source§

fn diff<'life0, 'life1, 'async_trait>( &'life0 self, dir: &'life1 Path, spec: DiffSpec, ) -> Pin<Box<dyn Future<Output = Result<Vec<FileDiff>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Parsed per-file unified diff for spec, layered on diff_text.
Source§

fn commit_count<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, revset: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Count commits in a revset (log -r <revset> --no-graph, one id per line).
Source§

fn is_conflicted<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, revset: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Whether the commit a revset resolves to has a conflict.
Source§

fn has_workingcopy_conflict<'life0, 'life1, 'async_trait>( &'life0 self, dir: &'life1 Path, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Whether the working copy has unresolved conflicts (jj status).
Source§

fn resolve_list<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, revset: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Paths with unresolved conflicts in revset (jj resolve --list -r <revset>). Empty when there are none.
Source§

fn template_query<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, dir: &'life1 Path, revset: &'life2 str, template: &'life3 str, limit: Option<usize>, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Run an arbitrary templated jj log query and return raw stdout (log -r <revset> --no-graph [--limit n] -T <template>).
Source§

fn description<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, revset: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

The full (possibly multiline) description of the commit revset resolves to, trailing whitespace trimmed; empty for an undescribed change — or for a revset matching no commit (an invalid revset still errors). A multi-commit revset yields only the newest commit’s description (jj log order, --limit 1).
Source§

fn evolog<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, revset: &'life2 str, max: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Change>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

How the commit a revset resolves to evolved, newest snapshot first, up to max (jj evolog -r <revset>) — one Change row per recorded predecessor.
Source§

fn file_annotate<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, path: &'life2 str, revset: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<Vec<AnnotationLine>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Per-line authorship of path (jj file annotate <path> [-r <revset>]; None = @): which change introduced each line.
Source§

fn file_show<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, dir: &'life1 Path, revset: &'life2 str, path: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

A file’s content at a revision (jj file show -r <revset> file:"<path>" — the path is wrapped as an exact-path fileset, so fileset metacharacters in the name stay literal). Content is decoded lossily — a binary file comes back mangled rather than erroring.
Source§

fn rebase<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, onto: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Rebase the working copy onto a destination (rebase -d <onto>).
Source§

fn rebase_branch<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, dir: &'life1 Path, branch: &'life2 str, dest: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Rebase a whole branch onto a destination (rebase -b <branch> -d <dest>).
Source§

fn edit<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, revset: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Move the working copy to a revision (edit <rev>).
Source§

fn squash_into<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, into: &'life2 str, use_destination_message: bool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Squash the working copy into a revision (squash --into <rev>). When use_destination_message, keep the destination’s description (--use-destination-message) instead of combining the two.
Source§

fn commit_paths<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, dir: &'life1 Path, filesets: &'life2 [JjFileset], message: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Finalise a commit from exactly these filesets (commit -m <message> <filesets>); the rest stay in the new working-copy change.
Source§

fn squash_paths<'life0, 'life1, 'async_trait>( &'life0 self, dir: &'life1 Path, spec: SquashPaths, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Squash exactly these filesets from one revision into another (squash --from <from> --into <into> [--use-destination-message] <filesets>).
Source§

fn sparse_set<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, patterns: &'life2 [String], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Set the working copy’s sparse patterns to exactly patterns (sparse set --clear --add <p>…); an empty list clears the working copy.
Source§

fn new_merge<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, message: &'life2 str, parents: Vec<String>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Create a new change with the given parents (new -m <msg> <p1> <p2> …).
Source§

fn abandon<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, revset: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Abandon a revision (abandon <rev>).
Source§

fn git_fetch_branch<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, branch: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fetch a single bookmark from origin (git fetch --remote origin -b <branch>); transient failures are retried (3×, 500 ms).
Source§

fn git_import<'life0, 'life1, 'async_trait>( &'life0 self, dir: &'life1 Path, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Import git refs into jj (jj git import) — colocated-repo sync.
Source§

fn git_clone<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, url: &'life1 str, dest: &'life2 Path, colocate: bool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Clone a git repository into dest (jj git clone <url> <dest> --colocate|--no-colocate). Runs without a working directory — pass an absolute dest. The flag is always passed explicitly: whether colocation (a visible .git alongside .jj) is jj’s default depends on the jj version and the user’s git.colocate config, so colocate decides deterministically.
Source§

fn absorb<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, from: Option<String>, filesets: &'life2 [JjFileset], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fold working-copy edits into the mutable ancestors that introduced the touched lines (absorb [--from <revset>] [<filesets>…]); empty filesets absorbs everything.
Source§

fn split_paths<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, dir: &'life1 Path, filesets: &'life2 [JjFileset], message: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Split exactly these filesets out of @ into their own commit described by message (split -m <message> <filesets>…); the remainder stays behind. filesets must be non-empty — a fileset-less split opens jj’s interactive diff editor (a headless hang), so it is refused with an error before spawning.
Source§

fn duplicate<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, revset: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Duplicate the commits a revset resolves to (duplicate <revset>).
Source§

fn op_head<'life0, 'life1, 'async_trait>( &'life0 self, dir: &'life1 Path, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The current operation id (op log --no-graph --limit 1) — capture before a risky sequence to roll back to.
Source§

fn op_log<'life0, 'life1, 'async_trait>( &'life0 self, dir: &'life1 Path, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Operation>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The newest limit operations, newest first (op log --no-graph --limit n).
Source§

fn op_restore<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, op_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Restore the repo to an operation (op restore <id>).
Source§

fn op_undo<'life0, 'life1, 'async_trait>( &'life0 self, dir: &'life1 Path, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Undo the latest operation (op undo).
Source§

fn workspace_list<'life0, 'life1, 'async_trait>( &'life0 self, dir: &'life1 Path, ) -> Pin<Box<dyn Future<Output = Result<Vec<Workspace>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List workspaces (workspace list).
Source§

fn workspace_root<'life0, 'life1, 'async_trait>( &'life0 self, dir: &'life1 Path, name: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<PathBuf>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Resolve a workspace’s root path (workspace root [--name <name>]).
Source§

fn workspace_add<'life0, 'life1, 'async_trait>( &'life0 self, dir: &'life1 Path, spec: WorkspaceAdd, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Add a workspace (workspace add --name <name> -r <base> <path>).
Source§

fn workspace_forget<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dir: &'life1 Path, name: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Forget a workspace (workspace forget <name>).

Auto Trait Implementations§

§

impl<R> Freeze for Jj<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for Jj<R>
where R: RefUnwindSafe,

§

impl<R> Send for Jj<R>

§

impl<R> Sync for Jj<R>

§

impl<R> Unpin for Jj<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for Jj<R>
where R: UnsafeUnpin,

§

impl<R> UnwindSafe for Jj<R>
where R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Any for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Source§

fn type_name(&self) -> &'static str

Source§

impl<T> AnySync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more