Struct git_topic_stage::Stager
[−]
[src]
pub struct Stager { /* fields omitted */ }
The actual stager.
This stores the state of a staging branch
Methods
impl Stager
[src]
fn new(ctx: &GitContext, base: CommitId, identity: Identity) -> Self
Create a new stage from the given commit.
fn from_branch(ctx: &GitContext,
base: CommitId,
stage: CommitId,
identity: Identity)
-> Result<Self>
base: CommitId,
stage: CommitId,
identity: Identity)
-> Result<Self>
Create a new stage, discovering topic branches which have already been merged.
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 those commits.
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.
fn git_context(&self) -> &GitContext
Returns the git context the stager uses for operations.
fn identity(&self) -> &Identity
Returns the identity the stager uses for its merges.
fn base(&self) -> &CommitId
Returns the base branch for the integration branch.
fn topics(&self) -> &[StagedTopic]
The topics which have been merged into the stage.
fn find_topic_by_id(&self, id: u64) -> Option<&StagedTopic>
The a topic on the stage by id.
fn find_topic(&self, topic: &Topic) -> Option<&StagedTopic>
Find a where a topic has been merged into the stage.
fn head(&self) -> &CommitId
Returns the newest commit in the integration branch.
fn unstage(&mut self, topic: StagedTopic) -> Result<StageResult>
Remove a topic branch from the stage.
fn stage(&mut self, topic: CandidateTopic) -> Result<StageResult>
Add a topic branch to the stage.
If the topic branch already existed on the staging branch, it is first removed from the stage and then any topic branches which were merged after it are merged again, in order. The updated topic branch is then merged as the last operation.
fn clear(&mut self) -> Vec<StagedTopic>
Remove all staged topics from the staging branch.
Previously staged topics are returned.