Skip to main content

VcsIntegration

Struct VcsIntegration 

Source
pub struct VcsIntegration {
    pub repo_dir: PathBuf,
    pub vcs_type: VcsType,
}
Expand description

Version control system integration.

Fields§

§repo_dir: PathBuf

The base directory of the repository.

§vcs_type: VcsType

The detected version control system type.

Implementations§

Source§

impl VcsIntegration

Source

pub fn new(repo_dir: &Path) -> Self

Creates a new VCS integration.

Source

pub fn detect_vcs(repo_dir: &Path) -> VcsType

Detects the version control system type in the given directory.

Source

pub fn get_vcs_type(&self) -> VcsType

Gets the detected version control system type.

Source

pub fn is_git_repo(&self) -> bool

Checks if the directory is a git repository.

Source

pub fn is_svn_repo(&self) -> bool

Checks if the directory is an SVN repository.

Source

pub fn is_hg_repo(&self) -> bool

Checks if the directory is a Mercurial repository.

Source

pub fn get_current_branch(&self) -> Result<String>

Gets the current branch for the detected VCS.

Source

pub fn get_git_branch(&self) -> Result<String>

Gets the current git branch.

Source

pub fn get_svn_branch(&self) -> Result<String>

Gets the current SVN branch.

Source

pub fn get_hg_branch(&self) -> Result<String>

Gets the current Mercurial branch.

Source

pub fn get_latest_commit(&self) -> Result<String>

Gets the latest commit hash for the detected VCS.

Source

pub fn get_git_commit(&self) -> Result<String>

Gets the latest git commit hash.

Source

pub fn get_svn_commit(&self) -> Result<String>

Gets the latest SVN revision.

Source

pub fn get_hg_commit(&self) -> Result<String>

Gets the latest Mercurial commit hash.

Source

pub fn get_status(&self) -> Result<String>

Gets the status for the detected VCS.

Source

pub fn get_git_status(&self) -> Result<String>

Gets the git status.

Source

pub fn get_svn_status(&self) -> Result<String>

Gets the SVN status.

Source

pub fn get_hg_status(&self) -> Result<String>

Gets the Mercurial status.

Source

pub fn generate_change_summary(&self) -> Result<String>

Generates a change summary for the detected VCS.

Source

pub fn generate_git_change_summary(&self) -> Result<String>

Generates a change summary from git.

Source

pub fn generate_svn_change_summary(&self) -> Result<String>

Generates a change summary from SVN.

Source

pub fn generate_hg_change_summary(&self) -> Result<String>

Generates a change summary from Mercurial.

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> Same for T

Source§

type Output = T

Should always be Self
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.