Package sonia.scm.repository.api
Class MergeCommandResult
java.lang.Object
sonia.scm.repository.api.MergeCommandResult
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 Summary
Modifier and TypeMethodDescriptionstatic MergeCommandResult
failure
(String targetRevision, String revisionToMerge, Collection<String> filesWithConflict) If the merge was not successful (isSuccess()
returnsfalse
) this will give you a list of file paths that could not be merged automatically.Returns the revision of the new head of the target branch, if the merge was successful (isSuccess()
)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).Returns the revision of the target branch prior to the merge.boolean
If this returnstrue
, the merge was successfull.static MergeCommandResult
-
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 returnstrue
, the merge was successfull. If this returnsfalse
there were merge conflicts. In this case you can usegetFilesWithConflict()
to check what files could not be merged. -
getFilesWithConflict
If the merge was not successful (isSuccess()
returnsfalse
) this will give you a list of file paths that could not be merged automatically. -
getNewHeadRevision
Returns the revision of the new head of the target branch, if the merge was successful (isSuccess()
) -
getTargetRevision
Returns the revision of the target branch prior to the merge. -
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).
-