JJWrapper

Struct JJWrapper 

Source
pub struct JJWrapper { /* private fields */ }
Expand description

Main wrapper for Jujutsu operations

Implementations§

Source§

impl JJWrapper

Source

pub fn new() -> JJWrapper

Create a new JJWrapper with default configuration

Source

pub fn with_config(config: JJConfig) -> Result<JJWrapper>

Create a new JJWrapper with custom configuration

Source

pub fn get_config(&self) -> JJConfig

Get the current configuration

Source

pub fn get_stats(&self) -> String

Get operation log statistics as JSON string

Source

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

Execute a jj command and return the result

Source

pub fn get_operations(&self, limit: usize) -> Result<Vec<JJOperation>>

Get operations from the operation log

Source

pub fn get_user_operations(&self, limit: usize) -> Result<Vec<JJOperation>>

Get user-initiated operations (exclude snapshots)

Source

pub async fn get_conflicts( &self, commit: Option<&str>, ) -> Result<Vec<JJConflict>>

Get conflicts in the current commit or specified commit

Source

pub async fn describe(&self, message: &str) -> Result<JJOperation>

Describe the current commit with a message

Source

pub async fn status(&self) -> Result<JJResult>

Get repository status

Source

pub async fn diff(&self, from: &str, to: &str) -> Result<JJDiff>

Get diff between two commits

Source

pub async fn new_commit(&self, message: Option<&str>) -> Result<JJResult>

Create a new commit (renamed from ‘new’ to avoid confusion with constructor)

Source

pub async fn edit(&self, revision: &str) -> Result<JJResult>

Edit a commit

Source

pub async fn abandon(&self, revision: &str) -> Result<JJResult>

Abandon a commit

Source

pub async fn squash( &self, from: Option<&str>, to: Option<&str>, ) -> Result<JJResult>

Squash commits

Source

pub async fn rebase(&self, source: &str, destination: &str) -> Result<JJResult>

Rebase commits

Source

pub async fn resolve(&self, path: Option<&str>) -> Result<JJResult>

Resolve conflicts

Source

pub async fn branch_create( &self, name: &str, revision: Option<&str>, ) -> Result<JJResult>

Create a branch

Source

pub async fn branch_delete(&self, name: &str) -> Result<JJResult>

Delete a branch

Source

pub async fn branch_list(&self) -> Result<Vec<JJBranch>>

List branches

Source

pub async fn undo(&self) -> Result<JJResult>

Undo the last operation

Source

pub async fn restore(&self, paths: &[&str]) -> Result<JJResult>

Restore files

Source

pub async fn log(&self, limit: Option<usize>) -> Result<Vec<JJCommit>>

Show commit log

Source

pub fn clear_log(&self)

Clear operation log

Source§

impl JJWrapper

Source

pub fn with_config_checked(config: JJConfig) -> Result<JJWrapper>

Create wrapper with config (Rust-only)

Trait Implementations§

Source§

impl Clone for JJWrapper

Source§

fn clone(&self) -> JJWrapper

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for JJWrapper

Source§

fn default() -> Self

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

Auto Trait Implementations§

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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.