Class MergeCommandResult

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

public class MergeCommandResult extends Object
This class keeps the result of a merge of branches. Use isSuccess() to check whether the merge was sucessfully executed. If the result is false the merge could not be done without conflicts. In this case you can use getFilesWithConflict() to get a list of files with merge conflicts.
  • Method Details

    • success

      public static MergeCommandResult success(String targetRevision, String revisionToMerge, String newHeadRevision)
    • failure

      public static MergeCommandResult failure(String targetRevision, String revisionToMerge, Collection<String> filesWithConflict)
    • isSuccess

      public boolean isSuccess()
      If this returns true, the merge was successfull. If this returns false there were merge conflicts. In this case you can use getFilesWithConflict() to check what files could not be merged.
    • getFilesWithConflict

      public Collection<String> getFilesWithConflict()
      If the merge was not successful (isSuccess() returns false) this will give you a list of file paths that could not be merged automatically.
    • getNewHeadRevision

      public String getNewHeadRevision()
      Returns the revision of the new head of the target branch, if the merge was successful (isSuccess())
    • getTargetRevision

      public String getTargetRevision()
      Returns the revision of the target branch prior to the merge.
    • getRevisionToMerge

      public String getRevisionToMerge()
      Returns the revision of the branch that was merged into the target (or in case of a conflict of the revision that should have been merged).