Documentation
¶
Index ¶
- Variables
- type PatchManager
- func (m PatchManager) ApplyCmd(p models.Project) (string, error)
- func (m PatchManager) ApplyUpdate(p models.Project, patch, commitID string, kv map[string]string) (models.Project, error)
- func (m PatchManager) Clean(p models.Project) bool
- func (m PatchManager) CreateWorktree(p models.Project, commitID, label string) (models.Project, error)
- func (m PatchManager) CurrentPatches() ([]string, error)
- func (m PatchManager) CurrentProject() (p models.Project, err error)
- func (m PatchManager) Delete(name string) error
- func (m PatchManager) Find(hash string, p models.Project) (models.Commit, error)
- func (m PatchManager) Head(p models.Project) (string, error)
- func (m PatchManager) Init(name, path string, overwrite bool) error
- func (m PatchManager) Names() ([]string, error)
- func (m PatchManager) NewReader(projects []models.Project) io.Reader
- func (m PatchManager) Projects(name string) ([]models.Project, error)
- func (m PatchManager) RebaseCommits(p models.Project, baseID string) ([]models.Commit, error)
- func (m PatchManager) RemovePatch(patch string) error
- func (m PatchManager) SaveRebased(p models.Project, baseID string, commits []models.Commit) error
- func (m PatchManager) SwitchProject(name string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("project not found") ErrNoCommits = errors.New("no commits found") )
Functions ¶
This section is empty.
Types ¶
type PatchManager ¶
type PatchManager struct {
// contains filtered or unexported fields
}
func FromFunc ¶
func FromFunc(d detectFn, r rcFn, s storeFn) PatchManager
func New ¶
func New() PatchManager
func (PatchManager) ApplyUpdate ¶
func (m PatchManager) ApplyUpdate(p models.Project, patch, commitID string, kv map[string]string, ) (models.Project, error)
ApplyUpdate is called after the commits have been applied with the ApplyCmd(). It will determine the additional commits from the commitID (last HEAD position), assign the patch label to those commits and store them in project p.
func (PatchManager) CreateWorktree ¶
func (PatchManager) CurrentPatches ¶
func (m PatchManager) CurrentPatches() ([]string, error)
func (PatchManager) CurrentProject ¶
func (m PatchManager) CurrentProject() (p models.Project, err error)
func (PatchManager) Delete ¶
func (m PatchManager) Delete(name string) error
Delete removes provided project
func (PatchManager) Init ¶
func (m PatchManager) Init(name, path string, overwrite bool) error
Init creats a new revision control project
func (PatchManager) Names ¶
func (m PatchManager) Names() ([]string, error)
func (PatchManager) NewReader ¶
func (m PatchManager) NewReader(projects []models.Project) io.Reader
func (PatchManager) Projects ¶
func (m PatchManager) Projects(name string) ([]models.Project, error)
func (PatchManager) RebaseCommits ¶
RebaseCommits fetches the commits between baseID and HEAD. The tags from the current project will be mapped onto the fetched commits based on either the commit hash or the commit subject.
func (PatchManager) RemovePatch ¶
func (m PatchManager) RemovePatch(patch string) error
func (PatchManager) SaveRebased ¶
SaveRebased checks if the commits actually exist in the repo, repopulate the info fields and saves the baseID for project p.
func (PatchManager) SwitchProject ¶
func (m PatchManager) SwitchProject(name string) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.