runstate

package
v12.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 10 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 {
	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"`
	IsUndo                   bool            `exhaustruct:"optional"` // TODO: remove?
	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 (self *RunState) HasAbortProgram() bool

func (*RunState) HasRunProgram

func (self *RunState) HasRunProgram() bool

func (*RunState) IsFinished added in v12.0.1

func (self *RunState) IsFinished() bool

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

func (self *RunState) RegisterUndoablePerennialCommit(commit gitdomain.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 gitdomain.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