Documentation ¶
Overview ¶
Package runstate represents the current execution status of a Git Town command. Runstates are created by the cmd package, executed by the runvm package, and persisted by the persistence package.
Index ¶
- type RunState
- func (self *RunState) AddPushBranchAfterCurrentBranchProgram(backend *git.BackendCommands) error
- func (self *RunState) HasAbortProgram() bool
- func (self *RunState) HasRunProgram() bool
- func (self *RunState) IsFinished() bool
- func (self *RunState) MarkAsFinished()
- func (self *RunState) MarkAsUnfinished(backend *git.BackendCommands) error
- func (self *RunState) RegisterUndoablePerennialCommit(commit gitdomain.SHA)
- func (self *RunState) SkipCurrentBranchProgram()
- func (self *RunState) String() string
- type UnfinishedRunStateDetails
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RunState ¶
type RunState struct { AbortProgram program.Program `exhaustruct:"optional"` BeginBranchesSnapshot gitdomain.BranchesSnapshot BeginConfigSnapshot undoconfig.ConfigSnapshot BeginStashSize gitdomain.StashSize Command string DryRun bool EndBranchesSnapshot gitdomain.BranchesSnapshot EndConfigSnapshot undoconfig.ConfigSnapshot EndStashSize gitdomain.StashSize FinalUndoProgram program.Program `exhaustruct:"optional"` RunProgram program.Program UndoablePerennialCommits []gitdomain.SHA `exhaustruct:"optional"` UnfinishedDetails *UnfinishedRunStateDetails `exhaustruct:"optional"` }
RunState represents the current state of a Git Town command, including which operations are left to do, and how to undo what has been done so far.
func EmptyRunState ¶
func EmptyRunState() RunState
func (*RunState) AddPushBranchAfterCurrentBranchProgram ¶
func (self *RunState) AddPushBranchAfterCurrentBranchProgram(backend *git.BackendCommands) error
AddPushBranchAfterCurrentBranchProgram inserts a PushBranch opcode after all the opcodes for the current branch.
func (*RunState) HasAbortProgram ¶
func (*RunState) HasRunProgram ¶
func (*RunState) IsFinished ¶
IsFinished returns whether or not the run state is unfinished.
func (*RunState) MarkAsFinished ¶
func (self *RunState) MarkAsFinished()
MarkAsFinished updates the run state to be marked as finished.
func (*RunState) MarkAsUnfinished ¶
func (self *RunState) MarkAsUnfinished(backend *git.BackendCommands) error
MarkAsUnfinished updates the run state to be marked as unfinished and populates informational fields.
func (*RunState) RegisterUndoablePerennialCommit ¶
RegisterUndoablePerennialCommit stores the given commit on a perennial branch as undoable. This method is used as a callback.
func (*RunState) SkipCurrentBranchProgram ¶
func (self *RunState) SkipCurrentBranchProgram()
SkipCurrentBranchProgram removes the opcodes for the current branch from this run state.
type UnfinishedRunStateDetails ¶
type UnfinishedRunStateDetails struct { CanSkip bool EndBranch gitdomain.LocalBranchName EndTime time.Time }
UnfinishedRunStateDetails has details about an unfinished run state.
func (UnfinishedRunStateDetails) String ¶
func (self UnfinishedRunStateDetails) String() string