runstate

package
v10.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2023 License: MIT Imports: 8 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RunState

type RunState struct {
	Command                  string
	IsAbort                  bool            `exhaustruct:"optional"`
	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

func (self *RunState) CreateAbortRunState() RunState

CreateAbortRunState returns a new runstate to be run to aborting and undoing the Git Town command represented by this runstate.

func (*RunState) CreateSkipRunState

func (self *RunState) CreateSkipRunState() RunState

CreateSkipRunState returns a new Runstate that skips operations for the current branch.

func (*RunState) CreateUndoRunState

func (self *RunState) CreateUndoRunState() RunState

CreateUndoRunState returns a new runstate to be run when undoing the Git Town command represented by this runstate.

func (*RunState) HasAbortProgram

func (self *RunState) HasAbortProgram() bool

func (*RunState) HasRunProgram

func (self *RunState) HasRunProgram() bool

func (*RunState) HasUndoProgram

func (self *RunState) HasUndoProgram() bool

func (*RunState) IsUnfinished

func (self *RunState) IsUnfinished() bool

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

func (self *RunState) RegisterUndoablePerennialCommit(commit domain.SHA)

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.

func (*RunState) String

func (self *RunState) String() string

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL