Enum Class VcsType

java.lang.Object
java.lang.Enum<VcsType>
com.atlassian.bamboo.testutils.vcs.VcsType
All Implemented Interfaces:
Serializable, Comparable<VcsType>, Constable

public enum VcsType extends Enum<VcsType>
Utility enum for testing VCS repositories.
  • Enum Constant Details

    • GIT

      public static final VcsType GIT
  • Method Details

    • values

      public static VcsType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static VcsType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - 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 by extractCommitInfo(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 executing listCommitsCommand(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 with stageChangesCommand(String).