Class RevertCommandBuilder

java.lang.Object
sonia.scm.repository.api.RevertCommandBuilder

public final class RevertCommandBuilder extends Object
Applies a revert of a chosen changeset onto the given repository/branch combination.
Since:
3.8
  • Constructor Details

    • RevertCommandBuilder

      public RevertCommandBuilder(RevertCommand command, @Nullable EMail email)
      Parameters:
      command - A RevertCommand implementation provided by some source.
  • Method Details

    • setAuthor

      public RevertCommandBuilder setAuthor(DisplayUser author)
      Use this to set the author of the revert commit manually. If this is omitted, the currently logged-in user will be used instead. If the given user object does not have an email address, we will use EMail to compute a fallback address.
      Parameters:
      author - Author entity.
      Returns:
      This instance.
    • setRevision

      public RevertCommandBuilder setRevision(String revision)
      Obligatory value.
      Parameters:
      revision - Identifier of the revision.
      Returns:
      This instance.
    • setBranch

      public RevertCommandBuilder setBranch(String branch)
      This is an optional parameter. Not every SCM system supports branches. If null or empty and supported by the SCM, the default branch of the repository shall be used.
      Parameters:
      branch - Name of the branch.
      Returns:
      This instance.
    • setMessage

      public RevertCommandBuilder setMessage(String message)
      This is an optional parameter. If null or empty, a default message will be set.
      Parameters:
      message - Particular message.
      Returns:
      This instance.
    • execute

      public RevertCommandResult execute()
      Executes the revert with the given builder parameters.
      Returns:
      RevertCommandResult with information about the executed revert.
    • getRequest

      protected RevertCommandRequest getRequest()