vci

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2019 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnknownVCS is returned when VCS cannot be determined from the vcs Repo
	ErrUnknownVCS = errors.New("Unknown VCS")
)

Functions

This section is empty.

Types

type GitRepo

type GitRepo struct {
	vcs.Repo
	FilesAll      map[string]struct{}
	FilesModified map[string]struct{}
	FilesAdded    map[string]struct{}
}

func (*GitRepo) Add

func (gr *GitRepo) Add(filename string) error

Add adds the file to the repo

func (*GitRepo) CacheFileNames

func (gr *GitRepo) CacheFileNames()

func (*GitRepo) CacheFilesAdded added in v0.9.6

func (gr *GitRepo) CacheFilesAdded()

func (*GitRepo) CacheFilesModified added in v0.9.6

func (gr *GitRepo) CacheFilesModified()

func (*GitRepo) CacheRefresh added in v0.9.6

func (gr *GitRepo) CacheRefresh()

func (*GitRepo) CommitFile

func (gr *GitRepo) CommitFile(filename string, message string) error

CommitFile commits single file to repo staging

func (*GitRepo) InRepo

func (gr *GitRepo) InRepo(filename string) bool

func (*GitRepo) IsAdded added in v0.9.6

func (gr *GitRepo) IsAdded(filename string) bool

func (*GitRepo) IsModified added in v0.9.6

func (gr *GitRepo) IsModified(filename string) bool

func (*GitRepo) Move

func (gr *GitRepo) Move(oldpath, newpath string) error

Move moves updates the repo with the rename

func (*GitRepo) Remove

func (gr *GitRepo) Remove(filename string) error

Remove removes the file from the repo

func (*GitRepo) RemoveKeepLocal

func (gr *GitRepo) RemoveKeepLocal(filename string) error

Remove removes the file from the repo

func (*GitRepo) RevertFile

func (gr *GitRepo) RevertFile(filename string) error

RevertFile reverts a single file to last commit of master

type Repo

type Repo interface {
	// vcs.Repo includes those interface functions
	vcs.Repo

	// CacheFileNames reads all of the file names stored in the repository
	// into a local cache to speed checking whether a file is in the repository or not.
	CacheFileNames()

	// CacheFilesModified gets a list of files in repository changed since last commit
	CacheFilesModified()

	// CacheFilesAdded gets a list of files added to repository but not yet committed
	CacheFilesAdded()

	// CacheRefresh calls all of the Cache functions
	CacheRefresh()

	// InRepo returns true if filename is in the repository -- uses CacheFileNames --
	// will do that automatically but if cache might be stale, call it to refresh
	InRepo(filename string) bool

	// IsModified checks against the cached list to see if the file is modified since the last commit
	// IsDirty() will check with the repo rather than the cached list
	IsModified(filename string) bool

	// IsAdded checks for the file in the cached FilesAdded list
	IsAdded(filename string) bool

	// Add adds the file to the repo
	Add(filename string) error

	// Move moves updates the repo with the rename
	Move(oldpath, newpath string) error

	// Remove removes the file from the repo
	Remove(filename string) error

	// RemoveKeepLocal removes the file from the repo but keeps the file itself
	RemoveKeepLocal(filename string) error

	// CommitFile commits a single file
	CommitFile(filename string, message string) error

	// RevertFile reverts a single file
	RevertFile(filename string) error
}

Repo provides an interface that parallels vcs.Repo (https://github.com/Masterminds/vcs) with some additional functions

func NewRepo

func NewRepo(remote, local string) (Repo, error)

type SvnRepo added in v0.9.7

type SvnRepo struct {
	vcs.Repo
	FilesAll      map[string]struct{}
	FilesModified map[string]struct{}
	FilesAdded    map[string]struct{}
}

func (*SvnRepo) Add added in v0.9.7

func (gr *SvnRepo) Add(filename string) error

Add adds the file to the repo

func (*SvnRepo) CacheFileNames added in v0.9.7

func (gr *SvnRepo) CacheFileNames()

func (*SvnRepo) CacheFilesAdded added in v0.9.7

func (gr *SvnRepo) CacheFilesAdded()

func (*SvnRepo) CacheFilesModified added in v0.9.7

func (gr *SvnRepo) CacheFilesModified()

func (*SvnRepo) CacheRefresh added in v0.9.7

func (gr *SvnRepo) CacheRefresh()

func (*SvnRepo) CommitFile added in v0.9.7

func (gr *SvnRepo) CommitFile(filename string, message string) error

CommitFile commits single file to repo staging

func (*SvnRepo) InRepo added in v0.9.7

func (gr *SvnRepo) InRepo(filename string) bool

func (*SvnRepo) IsAdded added in v0.9.7

func (gr *SvnRepo) IsAdded(filename string) bool

func (*SvnRepo) IsModified added in v0.9.7

func (gr *SvnRepo) IsModified(filename string) bool

func (*SvnRepo) Move added in v0.9.7

func (gr *SvnRepo) Move(oldpath, newpath string) error

Move moves updates the repo with the rename

func (*SvnRepo) Remove added in v0.9.7

func (gr *SvnRepo) Remove(filename string) error

Remove removes the file from the repo

func (*SvnRepo) RemoveKeepLocal added in v0.9.7

func (gr *SvnRepo) RemoveKeepLocal(filename string) error

Remove removes the file from the repo

func (*SvnRepo) RevertFile added in v0.9.7

func (gr *SvnRepo) RevertFile(filename string) error

RevertFile reverts a single file to last commit of master

Jump to

Keyboard shortcuts

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