Interface ScmPullRequestCommandFactory
commands
which provide pull request functionality. Each method accepts a set of
CommandParameters
which are used to control the command's behaviour and output.
Plugin developers: This is probably not the interface you want to use. PullRequestService
automatically chooses the correct SCM based on the repository, and provides a more stable, compatible API. The
documentation for each method on this interface includes a link to the API service method or methods which expose it.
-
Method Summary
Modifier and TypeMethodDescriptionchanges
(PullRequestChangesCommandParameters parameters, ChangeCallback callback) commits
(PullRequestCommitsCommandParameters parameters, CommitCallback callback) diff
(PullRequestDiffCommandParameters parameters, DiffContentCallback callback) Retrieves the diff stats summary for the effective diff of the given pull request.Retrieves the effective diff for the pull request.merge
(PullRequestMergeCommandParameters parameters) tryMerge
(PullRequest pullRequest) Attempt to merge the pull request to determine what the expected result of actually merging it would be.
-
Method Details
-
changes
@Nonnull Command<Void> changes(@Nonnull PullRequestChangesCommandParameters parameters, @Nonnull ChangeCallback callback) - Parameters:
parameters
- parameters describing how many changes to stream, and potentially for which pathscallback
- a callback to receive changes- Returns:
- a command which, when executed, will stream the changes the pull request wants to apply
- Since:
- 6.0
- See Also:
-
commits
@Nonnull Command<Void> commits(@Nonnull PullRequestCommitsCommandParameters parameters, @Nonnull CommitCallback callback) -
diff
@Nonnull Command<Void> diff(@Nonnull PullRequestDiffCommandParameters parameters, @Nonnull DiffContentCallback callback) - Parameters:
parameters
- parameters describing the paths to diff and what should be included in the diffs generatedcallback
- a callback to receive the diff- Returns:
- a command which, when executed, will stream the diff for the specified paths
- See Also:
-
diffStatsSummary
@Nonnull Command<DiffStatsSummary> diffStatsSummary(@Nonnull PullRequestDiffStatsSummaryCommandParameters parameters) Retrieves the diff stats summary for the effective diff of the given pull request.The stats summary include the total number of modified files, added lines, and deleted lines.
- Parameters:
parameters
- parameters describing the paths to diff and what should be included in the diffs generated- Returns:
- a command which, when executed, will retrieve the
diff stats summary
for the pull request. - Since:
- 9.1
- See Also:
-
effectiveDiff
Retrieves the effective diff for the pull request. The "effective diff" is comprised of the two commits that should be compared to get a view of what changes the pull request includes. When new commits are added to either of the branches involved in a pull request, the pull request's effective diff may change.Note: This method is not exposed via the service API. It is only available directly on the SCM API. The effective diff is something plugin developers generally do not need to be explicitly aware of. Instead, the
commits
,changes
anddiff(com.atlassian.bitbucket.scm.pull.PullRequestDiffCommandParameters, com.atlassian.bitbucket.content.DiffContentCallback)
should be retrieved using their respective commands.- Returns:
- a command which, when executed, will retrieve the
commit IDs
which describe the pull request's current effective diff
-
merge
- Parameters:
parameters
- parameters describing additional context which an SCM may consider when merging the pull request, potentially altering the way final shape of the merge- Returns:
- a command which, when executed, will merge the pull request, applying its changes to the target branch
- See Also:
-
tryMerge
Attempt to merge the pull request to determine what the expected result of actually merging it would be.- Parameters:
pullRequest
- the pull request to test for merge-ability- Returns:
- the result of trying to merge the pull request
- Since:
- 4.10
- See Also:
-