Struct Subtrees

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

Manages subtrees in a repository

Implementations§

Source§

impl Subtrees

Source

pub fn new() -> Result<Self, SubtreesError>

§Errors

Throws SubtreesError if fails to find or access repository.

Source

pub fn from_repo(repo: Repository) -> Result<Self, SubtreesError>

Discover subtrees in a git repository

Source

pub fn from_dir(path: &Path) -> Result<Self, SubtreesError>

Discover subtrees in specified directory

Source

pub fn add( &self, subtree: &SubtreeConfig, revision: Option<&str>, subject: Option<&str>, ) -> Result<(), AdditionError>

Add subtree to repository

§Errors

Throws errors when there are errors

§Panics

Panics when something unexpected happens

Source

pub fn all(&self) -> Result<Vec<SubtreeConfig>, ConfigError>

§Errors

Throws ConfigError if something goes wrong during parsing

Source

pub fn head(&self) -> Option<String>

Returns the repository head commit id

Source

pub fn pull( &self, subtree: &SubtreeConfig, git_ref: &str, ) -> Result<String, PullError>

Pull remote changes in the specified subtree

Source

pub fn split(&self, subtree: &SubtreeConfig) -> Result<(), SplitError>

Split changes in a subtree to own artificial history and merge it back into HEAD

Source

pub fn push( &self, subtree: &SubtreeConfig, git_ref: &str, ) -> Result<(), PushError>

Push subtree changes to remote

Source

pub fn changed_modules( &self, id: &str, ) -> Result<Vec<SubtreeConfig>, ConfigError>

List modules with changes since specified git commit id

Source

pub fn find_subtree(&self, needle: &str) -> Result<SubtreeConfig, FindError>

Find subtree by name

Trait Implementations§

Source§

impl Debug for Subtrees

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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> 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, 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.