Enum VcsType
- java.lang.Object
-
- java.lang.Enum<VcsType>
-
- com.atlassian.bamboo.testutils.vcs.VcsType
-
- All Implemented Interfaces:
Serializable
,Comparable<VcsType>
public enum VcsType extends Enum<VcsType>
Utility enum for testing VCS repositories.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description GIT
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
checkoutRevisionCommand(String revision)
Command which will checkout the specified revision.String
commitChangesCommand(String message)
Locally commit changes previously staged withstageChangesCommand(String)
.String
createBranchCommand(String branch)
Command to create a new branch.CommitInfo
extractCommitInfo(String commitCommandOutput)
Parse one line of the result of executinglistCommitsCommand(String)
.String
listBranchesCommand()
Command which will list all branches defined in the repository.String
listCommitsCommand(String branch)
Command which will list all commits for the VCS repository in a format that can be later accepted byextractCommitInfo(String)
.String
listTagsCommand()
Command which will list all tags defined in the repository.String
mainBranch()
Get the name of the main, default branch of the repository.String
pullCommand()
Command to pull most recent changes from a remote.String
stageChangesCommand(String path)
Command to stage specified changes (add/remove tracked files) for committing.static VcsType
valueOf(String name)
Returns the enum constant of this type with the specified name.static VcsType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
GIT
public static final VcsType GIT
-
-
Method Detail
-
values
public static VcsType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (VcsType c : VcsType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static VcsType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
mainBranch
public String mainBranch()
Get the name of the main, default branch of the repository.
-
listCommitsCommand
public String listCommitsCommand(String branch)
Command which will list all commits for the VCS repository in a format that can be later accepted byextractCommitInfo(String)
. Newest commits should come first. Should work on a bare repository.
-
extractCommitInfo
public CommitInfo extractCommitInfo(String commitCommandOutput)
Parse one line of the result of executinglistCommitsCommand(String)
.
-
listBranchesCommand
public String listBranchesCommand()
Command which will list all branches defined in the repository. Should work on a bare repository.
-
listTagsCommand
public String listTagsCommand()
Command which will list all tags defined in the repository. Should work on a bare repository.
-
checkoutRevisionCommand
public String checkoutRevisionCommand(String revision)
Command which will checkout the specified revision. Will only be executed on a working copy of the repository.
-
pullCommand
public String pullCommand()
Command to pull most recent changes from a remote. Will only be executed on a working copy of the repository.
-
createBranchCommand
public String createBranchCommand(String branch)
Command to create a new branch. Will only be executed on a working copy of the repository.
-
stageChangesCommand
public String stageChangesCommand(String path)
Command to stage specified changes (add/remove tracked files) for committing. Will only be executed on a working copy of the repository.
-
commitChangesCommand
public String commitChangesCommand(String message)
Locally commit changes previously staged withstageChangesCommand(String)
.
-
-