[][src]Struct git_topic_stage::Stager

pub struct Stager { /* fields omitted */ }

A manager for an integration branch.

This stores the state of a staging branch and the representative topics.

Methods

impl Stager[src]

pub fn new(ctx: &GitContext, base: CommitId) -> Self[src]

Create a new stage from the given commit.

pub fn from_branch(
    ctx: &GitContext,
    base: CommitId,
    stage: CommitId
) -> Result<Self, StagerError>
[src]

Create a new stage, discovering topics which have been merged into an integration branch.

This constructor takes a base branch and the name of the stage branch. It queries the given Git context for the history of the stage branch from the base and constructs its state from its first parent history.

If the stage does not exist, it is created with the base commit as its start.

Fails if the stage branch history does not appear to be a proper stage branch. A proper stage branch's first parent history from the base consists only of merge commits with exactly two parents with required information in its commit message.

pub fn git_context(&self) -> &GitContext[src]

Returns the git context the stager uses for operations.

pub fn base(&self) -> &CommitId[src]

Returns the base branch for the integration branch.

pub fn topics(&self) -> &[StagedTopic][src]

The topics which have been merged into the stage.

pub fn find_topic_by_id(&self, id: u64) -> Option<&StagedTopic>[src]

The a topic on the stage by its ID.

pub fn find_topic(&self, topic: &Topic) -> Option<&StagedTopic>[src]

Find where a topic has been merged into the integration branch.

pub fn head(&self) -> &CommitId[src]

Returns the newest commit in the integration branch.

pub fn unstage(
    &mut self,
    topic: StagedTopic
) -> Result<StageResult, StagerError>
[src]

Remove a topic from the stage.

pub fn stage(
    &mut self,
    topic: CandidateTopic
) -> Result<StageResult, StagerError>
[src]

Add a topic branch to the stage.

If the branch already existed on the staging branch, it is first removed from the stage and then any topics which were merged after it are merged again, in order. The updated topic is then merged as the last operation.

pub fn clear(&mut self) -> Vec<StagedTopic>[src]

Remove all staged topics from the staging branch.

Previously staged topics are returned.

Trait Implementations

impl Debug for Stager[src]

Auto Trait Implementations

impl Send for Stager

impl Sync for Stager

impl Unpin for Stager

impl UnwindSafe for Stager

impl RefUnwindSafe for Stager

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]