Documentation
¶
Index ¶
- Variables
- type GitRepo
- func (gr *GitRepo) Add(filename string) error
- func (gr *GitRepo) CacheFileNames()
- func (gr *GitRepo) CacheFilesAdded()
- func (gr *GitRepo) CacheFilesModified()
- func (gr *GitRepo) CacheRefresh()
- func (gr *GitRepo) CommitFile(filename string, message string) error
- func (gr *GitRepo) InRepo(filename string) bool
- func (gr *GitRepo) IsAdded(filename string) bool
- func (gr *GitRepo) IsModified(filename string) bool
- func (gr *GitRepo) Move(oldpath, newpath string) error
- func (gr *GitRepo) Remove(filename string) error
- func (gr *GitRepo) RemoveKeepLocal(filename string) error
- func (gr *GitRepo) RevertFile(filename string) error
- type Repo
- type SvnRepo
- func (gr *SvnRepo) Add(filename string) error
- func (gr *SvnRepo) CacheFileNames()
- func (gr *SvnRepo) CacheFilesAdded()
- func (gr *SvnRepo) CacheFilesModified()
- func (gr *SvnRepo) CacheRefresh()
- func (gr *SvnRepo) CommitFile(filename string, message string) error
- func (gr *SvnRepo) InRepo(filename string) bool
- func (gr *SvnRepo) IsAdded(filename string) bool
- func (gr *SvnRepo) IsModified(filename string) bool
- func (gr *SvnRepo) Move(oldpath, newpath string) error
- func (gr *SvnRepo) Remove(filename string) error
- func (gr *SvnRepo) RemoveKeepLocal(filename string) error
- func (gr *SvnRepo) RevertFile(filename string) error
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) 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 ¶
CommitFile commits single file to repo staging
func (*GitRepo) IsModified ¶ added in v0.9.6
func (*GitRepo) RemoveKeepLocal ¶
Remove removes the file from the repo
func (*GitRepo) RevertFile ¶
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
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) 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
CommitFile commits single file to repo staging
func (*SvnRepo) IsModified ¶ added in v0.9.7
func (*SvnRepo) RemoveKeepLocal ¶ added in v0.9.7
Remove removes the file from the repo
func (*SvnRepo) RevertFile ¶ added in v0.9.7
RevertFile reverts a single file to last commit of master
Click to show internal directories.
Click to hide internal directories.