repo

package
v0.0.0-...-3efa1d4 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package repo manages interfacing with a repo

Index

Constants

This section is empty.

Variables

View Source
var ErrUserActionRequired = errors.New("conflicts during cherry pick")

ErrUserActionRequired is returned when an action couldn't be completed and requires user intervention.

Functions

This section is empty.

Types

type PatchsetCache

type PatchsetCache struct {
	Slice []*patchset.Patchset
	Index map[string]int
	Map   map[string]*patchset.Patchset
}

PatchsetCache provides a convenient way to look up cached patchsets.

type Repo

type Repo struct {
	// contains filtered or unexported fields
}

Repo wraps git repo state for repository manipulations

func Init

func Init(base string) (*Repo, error)

Init initializes kilt in the current branch.

func Open

func Open() (*Repo, error)

Open tries to open a repo in the current working directory

func (*Repo) AddPatchset

func (r *Repo) AddPatchset(ps *patchset.Patchset) error

AddPatchset will add the given patchset to the head of the repo

func (*Repo) CheckoutBase

func (r *Repo) CheckoutBase() error

CheckoutBase will checkout the kilt base rev.

func (*Repo) CheckoutBranch

func (r *Repo) CheckoutBranch(name string) error

CheckoutBranch will checkout the given branch.

func (*Repo) CheckoutIndirectBranch

func (r *Repo) CheckoutIndirectBranch(name string) error

CheckoutIndirectBranch will resolve the ref and checkout the branch that the resolved target points to.

func (*Repo) CheckoutPatchset

func (r *Repo) CheckoutPatchset(patchset string) error

CheckoutPatchset will checkout the latest patch in the given patchset.

func (*Repo) CheckoutRev

func (r *Repo) CheckoutRev(rev string) error

CheckoutRev will checkout the given rev.

func (*Repo) CherryPickToHead

func (r *Repo) CherryPickToHead(id string) error

CherryPickToHead will cherrypick a commit with the given id to the current head.

func (*Repo) CompareTreeToHead

func (r *Repo) CompareTreeToHead(kiltRef string) (bool, error)

CompareTreeToHead checks whether the tree pointed to by kiltRef is equal to the tree at head.

func (*Repo) DeleteKiltRef

func (r *Repo) DeleteKiltRef(name string) error

DeleteKiltRef will delete the specified kilt ref.

func (*Repo) DescribeCommit

func (r *Repo) DescribeCommit(id string) (string, error)

DescribeCommit returns a short ID and description for the commit.

func (*Repo) DetachHead

func (r *Repo) DetachHead() error

DetachHead will detach the head from the current branch but stay on the same commit.

func (*Repo) KiltBase

func (r *Repo) KiltBase() string

KiltBase returns the id of the kilt branch base commit.

func (*Repo) KiltBranch

func (r *Repo) KiltBranch() string

KiltBranch returns the name of the current kilt branch.

func (*Repo) KiltDirectory

func (r *Repo) KiltDirectory() string

KiltDirectory returns a full path to the kilt subdirectory of the .git directory.

func (*Repo) LookupKiltRef

func (r *Repo) LookupKiltRef(name string) (string, error)

LookupKiltRef will lookup the specified ref name under the kilt ref path.

func (*Repo) PatchsetCache

func (r *Repo) PatchsetCache() (PatchsetCache, error)

PatchsetCache reads and returns a map of patchset names to an index in the patchset list

func (*Repo) PatchsetIndex

func (r *Repo) PatchsetIndex() (map[string]int, error)

PatchsetIndex reads and returns a map of patchset names to an index in the patchset list

func (*Repo) PatchsetMap

func (r *Repo) PatchsetMap() (map[string]*patchset.Patchset, error)

PatchsetMap reads and returns a map of patchset names to patchsets

func (*Repo) Patchsets

func (r *Repo) Patchsets() ([]*patchset.Patchset, error)

Patchsets reads and returns an ordered list of patchsets

func (*Repo) ReworkInProgress

func (r *Repo) ReworkInProgress() (bool, error)

ReworkInProgress checks whether there is currently a rework operation in progress.

func (*Repo) SetBranchToHead

func (r *Repo) SetBranchToHead(name string) error

SetBranchToHead will set the given branch to point to HEAD.

func (*Repo) SetHead

func (r *Repo) SetHead(name string) error

SetHead will set the current head to the given kilt ref.

func (*Repo) SetIndirectBranchToHead

func (r *Repo) SetIndirectBranchToHead(name string) error

SetIndirectBranchToHead will resolve the ref and set head to point to the resolved target.

func (*Repo) UpdateMetadataForCommit

func (r *Repo) UpdateMetadataForCommit(id string) error

UpdateMetadataForCommit will increment the version number of the given metadata commit.

func (*Repo) WriteRefHead

func (r *Repo) WriteRefHead(name string) error

WriteRefHead will write the current head to the specified kilt ref.

func (*Repo) WriteSymbolicRefBranch

func (r *Repo) WriteSymbolicRefBranch(name, branchName string) error

WriteSymbolicRefBranch will write the given symbolic branch to the specified kilt ref.

func (*Repo) WriteSymbolicRefHead

func (r *Repo) WriteSymbolicRefHead(name string) error

WriteSymbolicRefHead will write the current symbolic head to the specified kilt ref.

Jump to

Keyboard shortcuts

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