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) CreateAbortRunState() RunState
- func (self *RunState) CreateSkipRunState() RunState
- func (self *RunState) CreateUndoRunState() RunState
- func (self *RunState) HasAbortProgram() bool
- func (self *RunState) HasRunProgram() bool
- func (self *RunState) HasUndoProgram() bool
- func (self *RunState) IsUnfinished() bool
- func (self *RunState) MarkAsFinished()
- func (self *RunState) MarkAsUnfinished(backend *git.BackendCommands) error
- func (self *RunState) RegisterUndoablePerennialCommit(commit domain.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 { Command string IsUndo bool `exhaustruct:"optional"` AbortProgram program.Program `exhaustruct:"optional"` RunProgram program.Program UndoProgram program.Program `exhaustruct:"optional"` InitialActiveBranch domain.LocalBranchName FinalUndoProgram program.Program `exhaustruct:"optional"` UnfinishedDetails *UnfinishedRunStateDetails `exhaustruct:"optional"` UndoablePerennialCommits []domain.SHA `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) CreateAbortRunState ¶
CreateAbortRunState returns a new runstate to be run to aborting and undoing the Git Town command represented by this runstate.
func (*RunState) CreateSkipRunState ¶
CreateSkipRunState returns a new Runstate that skips operations for the current branch.
func (*RunState) CreateUndoRunState ¶
CreateUndoRunState returns a new runstate to be run when undoing the Git Town command represented by this runstate.
func (*RunState) HasAbortProgram ¶
func (*RunState) HasRunProgram ¶
func (*RunState) HasUndoProgram ¶
func (*RunState) IsUnfinished ¶
IsUnfinished 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 domain.LocalBranchName EndTime time.Time }
UnfinishedRunStateDetails has details about an unfinished run state.
func (UnfinishedRunStateDetails) String ¶
func (self UnfinishedRunStateDetails) String() string