stacktest

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package stacktest provides an in-memory stack backend for tests. Branch creation and checkout happen in the real temporary repository; the graph lives in memory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {

	// Restacks records the scopes requested. RestackErr, when set, is
	// returned by Restack.
	Restacks   []stack.Scope
	RestackErr error
	Continued  int
	Aborted    int
	// Submits records submit options; SubmitFn, when set, runs on submit.
	Submits  []stack.SubmitOptions
	SubmitFn func(o stack.SubmitOptions) error
	// contains filtered or unexported fields
}

Backend implements every stack port in memory.

func New

func New(g *git.Client, graph *stack.Graph) *Backend

New returns a Backend over g with the given initial graph.

func (*Backend) Abort

func (b *Backend) Abort(context.Context, git.Repo) error

func (*Backend) AddTop

func (b *Backend) AddTop(ctx context.Context, repo git.Repo, name string) error

func (*Backend) Continue

func (b *Backend) Continue(context.Context, git.Repo) error

func (*Backend) Graph

func (b *Backend) Graph() *stack.Graph

Graph returns the current graph.

func (*Backend) InitStack

func (b *Backend) InitStack(ctx context.Context, repo git.Repo, trunk string, branches []string) error

func (*Backend) Load

func (b *Backend) Load(context.Context, git.Repo) (*stack.Graph, error)

func (*Backend) Restack

func (b *Backend) Restack(_ context.Context, _ git.Repo, scope stack.Scope) error

func (*Backend) SetGraph

func (b *Backend) SetGraph(g *stack.Graph)

SetGraph replaces the graph.

func (*Backend) Submit

func (*Backend) Update added in v0.1.4

func (b *Backend) Update(_ context.Context, _ git.Repo, fn func(*stack.Graph) error) error

Jump to

Keyboard shortcuts

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