Documentation ¶
Overview ¶
Package vcs supports interacting with version control systems.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoVCSInDir = errors.New("could not find VCS repository in directory") ErrNoNearestVCS = errors.New("could not find nearest VCS repository in directory") )
Errors that occur when finding VCS repositories.
Functions ¶
func MetadataFolder ¶ added in v0.7.2
Types ¶
type GitRepository ¶ added in v0.7.27
type GitRepository struct {
// contains filtered or unexported fields
}
GitRepository implements the System interface.
func NewGitRepository ¶ added in v0.7.27
func NewGitRepository(dir string) (*GitRepository, error)
NewGitRepository uses the git repository's metadata at dir to identify the codebase.
func (*GitRepository) Head ¶ added in v0.7.27
func (gr *GitRepository) Head() Revision
func (*GitRepository) Project ¶ added in v0.7.27
func (gr *GitRepository) Project() string
type MercurialRepository ¶ added in v0.7.30
type MercurialRepository struct {
// contains filtered or unexported fields
}
MercurialRepository implements the System interface.
func NewMercurialRepository ¶ added in v0.7.30
func NewMercurialRepository(dir string) (*MercurialRepository, error)
NewMercurialRepository uses the Mercurial repository's metadata at dir to identify the codebase.
func (MercurialRepository) Head ¶ added in v0.7.30
func (m MercurialRepository) Head() Revision
func (MercurialRepository) Project ¶ added in v0.7.30
func (m MercurialRepository) Project() string
type NoRepository ¶ added in v0.7.27
type NoRepository struct {
// contains filtered or unexported fields
}
NoRepository implements the System interface. This is used for projects that are not version controlled.
func NewNoRepository ¶ added in v0.7.27
func NewNoRepository(dir string) (*NoRepository, error)
NewNoRepository uses the name of dir and the current time to identify the codebase.
func (*NoRepository) Head ¶ added in v0.7.27
func (nr *NoRepository) Head() Revision
func (*NoRepository) Project ¶ added in v0.7.27
func (nr *NoRepository) Project() string
type SubversionRepository ¶ added in v0.7.27
type SubversionRepository struct {
// contains filtered or unexported fields
}
SubversionRepository implements the System interface.
func NewSubversionRepository ¶ added in v0.7.27
func NewSubversionRepository(dir string) (*SubversionRepository, error)
NewSubversionRepository uses the Subversion repository's metadata at dir to identify the codebase.
func (*SubversionRepository) Head ¶ added in v0.7.27
func (s *SubversionRepository) Head() Revision
func (*SubversionRepository) Project ¶ added in v0.7.27
func (s *SubversionRepository) Project() string
type System ¶ added in v0.7.27
type System interface { // Project returns the string uniquely identifying this codebase. Project() string // Head returns the latest revision that is being examined. Head() Revision }
A System represents the current state of a version-controlled repository.
type VCS ¶ added in v0.7.2
type VCS int
VCS represents a type of version control system.
const ( Subversion VCS Git Mercurial Bazaar None )
func In ¶ added in v0.7.2
In returns the type of VCS repository rooted at a directory, or ErrNoVCSInDir if none is found.