Documentation ¶
Index ¶
- func AllCommits(repoName RepoName) ([]string, error)
- func CleanupTemporaryDirectories()
- func ClearAllRepositories()
- func FindFilesInDirectory(repoName RepoName, path string, pattern *regexp.Regexp, ...) ([]string, error)
- func PathInRepo(repoName RepoName, path string) (string, error)
- func RegisterRepository(name RepoName, path RepoPath)
- func SetBaseRepoInfo(repoPath RepoPath, repoName RepoName)
- type RemotePath
- type RepoName
- type RepoPath
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllCommits ¶
AllCommits returns the list of commits formatted as "ID DATE". @llr REQ-TRAQ-SWL-16
func CleanupTemporaryDirectories ¶
func CleanupTemporaryDirectories()
Removes any temporary directories where repositories have been cloned @llr REQ-TRAQ-SWL-49
func ClearAllRepositories ¶
func ClearAllRepositories()
Unregisters all repositories from the registry, leaving it empty @llr REQ-TRAQ-SWL-49
func FindFilesInDirectory ¶
func FindFilesInDirectory(repoName RepoName, path string, pattern *regexp.Regexp, ignoredPaths []*regexp.Regexp) ([]string, error)
Finds files in the given repository, returning an array of paths to each matched file Its arguments are: - `repoName`: Repo where files are located - `path`: The path to look in. Only files in this path (relative to the root of the repo) will be matched. - `pattern` The pattern to match against. If the pattern matches, it is added to the result array. - `ignoredPaths`: Any ignored path regexp. If the file matches any regular expression in this array it will not be matched @llr REQ-TRAQ-SWL-49, REQ-TRAQ-SWL-51
func PathInRepo ¶
Returns an absolute path to a file inside a repository. It validates that the file exists. If it doesn't an error is returned. @llr REQ-TRAQ-SWL-49, REQ-TRAQ-SWL-51
func RegisterRepository ¶
Registers a repository in the registry, that can be queried using the repository name. @llr REQ-TRAQ-SWL-49
func SetBaseRepoInfo ¶
Collects the information about the base repository (the repository where the reqtraq command is run) @llr REQ-TRAQ-SWL-49
Types ¶
type RemotePath ¶
type RemotePath string
A reference to a remote repository that can be one of:
- An HTTP url referencing a remote git repository
- A ssh url referencing a remote git repository
- A git url referencing a remote git repository
- A local repository that will be cloned
TODO(ja): Allow the user to specify a custom branch/git ref in this path
type RepoName ¶
type RepoName string
Identifies a single repository
func BaseRepoName ¶
func BaseRepoName() RepoName
Returns the name to the base repository. Requires that SetBaseRepoInfo has been called before. @llr REQ-TRAQ-SWL-49
type RepoPath ¶
type RepoPath string
A path to a local repository that is present in the current filesystem
func BaseRepoPath ¶
func BaseRepoPath() RepoPath
Returns the local path to the base repository. Requires that SetBaseRepoInfo has been called before. @llr REQ-TRAQ-SWL-49
func GetRepo ¶
func GetRepo(repoName RepoName, remotePath RemotePath, gitReference string, override bool) (RepoPath, error)
Gets the local path to a repository by name. The remotePath will be used to create a local repository copy if the repository is not registered or the override flag is set. @llr REQ-TRAQ-SWL-49, REQ-TRAQ-SWL-50
func GetRepoPathByName ¶
Obtains the local path to a repository from its name, if the repository is registered @llr REQ-TRAQ-SWL-49