Interface PluginPullRequestCommandFactory
-
Method Summary
Modifier and TypeMethodDescriptioncom.atlassian.bitbucket.scm.Command<Void>
bulkRescope
(BulkRescopeCommandParameters parameters) com.atlassian.bitbucket.scm.Command<Void>
changes
(com.atlassian.bitbucket.pull.PullRequest pullRequest, com.atlassian.bitbucket.scm.pull.PullRequestChangesCommandParameters parameters, com.atlassian.bitbucket.content.ChangeCallback callback) com.atlassian.bitbucket.scm.Command<Void>
commits
(com.atlassian.bitbucket.pull.PullRequest pullRequest, com.atlassian.bitbucket.scm.pull.PullRequestCommitsCommandParameters parameters, com.atlassian.bitbucket.commit.CommitCallback callback) default com.atlassian.bitbucket.scm.Command<Void>
delete
(com.atlassian.bitbucket.pull.PullRequest pullRequest, PullRequestDeleteCommandParameters parameters) Deletes repository data associated with the specified pull request.default com.atlassian.bitbucket.scm.Command<Void>
delete
(com.atlassian.bitbucket.repository.Repository repository, long pullRequestId, PullRequestDeleteCommandParameters parameters) Deletes repository data associated with the specified pull request.com.atlassian.bitbucket.scm.Command<Void>
diff
(com.atlassian.bitbucket.pull.PullRequest pullRequest, com.atlassian.bitbucket.scm.pull.PullRequestDiffCommandParameters parameters, com.atlassian.bitbucket.content.DiffContentCallback callback) com.atlassian.bitbucket.scm.Command<com.atlassian.bitbucket.content.DiffStatsSummary>
diffStatsSummary
(com.atlassian.bitbucket.pull.PullRequest pullRequest, com.atlassian.bitbucket.scm.pull.PullRequestDiffStatsSummaryCommandParameters parameters) Retrieves the diff stats summary for the effective diff of the given pull request.com.atlassian.bitbucket.scm.Command<com.atlassian.bitbucket.scm.pull.PullRequestEffectiveDiff>
effectiveDiff
(com.atlassian.bitbucket.pull.PullRequest pullRequest) com.atlassian.bitbucket.scm.Command<com.atlassian.bitbucket.repository.Branch>
merge
(com.atlassian.bitbucket.pull.PullRequest pullRequest, com.atlassian.bitbucket.scm.pull.PullRequestMergeCommandParameters parameters) com.atlassian.bitbucket.scm.Command<com.atlassian.bitbucket.pull.PullRequestMergeResult>
tryMerge
(com.atlassian.bitbucket.pull.PullRequest pullRequest) Attempt to merge the pull request to determine what the expected result of actually merging it would be.default com.atlassian.bitbucket.scm.Command<Void>
updateRefs
(UpdatePullRequestRefsCommandParameters parameters) Implementors: The default implementation of this method will be removed in 9.0.
-
Method Details
-
bulkRescope
@Nonnull com.atlassian.bitbucket.scm.Command<Void> bulkRescope(@Nonnull BulkRescopeCommandParameters parameters) - Parameters:
parameters
- describes the repository and provides a context for the command to use to retrieve affected rescopes and apply updates- Returns:
- a command which, when called, will analyse any rescopes from the provided context
- Since:
- 4.5
-
changes
@Nonnull com.atlassian.bitbucket.scm.Command<Void> changes(@Nonnull com.atlassian.bitbucket.pull.PullRequest pullRequest, @Nonnull com.atlassian.bitbucket.scm.pull.PullRequestChangesCommandParameters parameters, @Nonnull com.atlassian.bitbucket.content.ChangeCallback callback) - Parameters:
pullRequest
- the pull request to stream changes forparameters
- parameters describing the changes to streamcallback
- a callback to receive changes- Returns:
- a command which, when called, will stream changes for the specified pull request
- Since:
- 6.0
-
commits
@Nonnull com.atlassian.bitbucket.scm.Command<Void> commits(@Nonnull com.atlassian.bitbucket.pull.PullRequest pullRequest, @Nonnull com.atlassian.bitbucket.scm.pull.PullRequestCommitsCommandParameters parameters, @Nonnull com.atlassian.bitbucket.commit.CommitCallback callback) - Parameters:
pullRequest
- describes the refs being comparedparameters
- parameters providing context for the pull request commitscallback
- a callback to receive commits which are unique to thefrom ref
- Returns:
- a command which, when called, will stream commits referenced by the
from ref
which are not referenced by theto ref
- Since:
- 6.0
-
delete
@Nonnull default com.atlassian.bitbucket.scm.Command<Void> delete(@Nonnull com.atlassian.bitbucket.pull.PullRequest pullRequest, @Nonnull PullRequestDeleteCommandParameters parameters) Deletes repository data associated with the specified pull request.SCMs must not delete the
from
orto
refs. This command is intended to delete any internal, SCM-specific data the SCM tracks for pull requests. For example, if an SCM maintains additional commits or merges, or cached data such as change, diff or conflict details used to speed up other operations, or extra refs used to allow that data to be fetched, those are the types of data implementations of this command should remove.Even if an SCM does not track any additional data beyond the refs involved in the pull request, the returned
Command
must be non-null
. Such SCMs may wish to leverage the default implementation, which returns a command that does nothing when called.- Parameters:
pullRequest
- the pull request to deleteparameters
- parameters providing context for the deleted pull request- Returns:
- a command which, when called, will delete the specified pull request, releasing any artifacts, such as refs or objects, that are associated with it
- Since:
- 5.1
-
delete
@Nonnull default com.atlassian.bitbucket.scm.Command<Void> delete(@Nonnull com.atlassian.bitbucket.repository.Repository repository, long pullRequestId, @Nonnull PullRequestDeleteCommandParameters parameters) Deletes repository data associated with the specified pull request.SCMs must not delete the
from
orto
refs. This command is intended to delete any internal, SCM-specific data the SCM tracks for pull requests. For example, if an SCM maintains additional commits or merges, or cached data such as change, diff or conflict details used to speed up other operations, or extra refs used to allow that data to be fetched, those are the types of data implementations of this command should remove.Even if an SCM does not track any additional data beyond the refs involved in the pull request, the returned
Command
must be non-null
. Such SCMs may wish to leverage the default implementation, which returns a command that does nothing when called.- Parameters:
repository
- the repository of the pull request to deletepullRequestId
- the repository scoped ID of the pull request to deleteparameters
- parameters providing context for the deleted pull request- Returns:
- a command which, when called, will delete the specified pull request, releasing any artifacts, such as refs or objects, that are associated with it
- Since:
- 9.0
-
diff
@Nonnull com.atlassian.bitbucket.scm.Command<Void> diff(@Nonnull com.atlassian.bitbucket.pull.PullRequest pullRequest, @Nonnull com.atlassian.bitbucket.scm.pull.PullRequestDiffCommandParameters parameters, @Nonnull com.atlassian.bitbucket.content.DiffContentCallback callback) -
diffStatsSummary
@Nonnull com.atlassian.bitbucket.scm.Command<com.atlassian.bitbucket.content.DiffStatsSummary> diffStatsSummary(@Nonnull com.atlassian.bitbucket.pull.PullRequest pullRequest, @Nonnull com.atlassian.bitbucket.scm.pull.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
-
effectiveDiff
@Nonnull com.atlassian.bitbucket.scm.Command<com.atlassian.bitbucket.scm.pull.PullRequestEffectiveDiff> effectiveDiff(@Nonnull com.atlassian.bitbucket.pull.PullRequest pullRequest) -
merge
@Nonnull com.atlassian.bitbucket.scm.Command<com.atlassian.bitbucket.repository.Branch> merge(@Nonnull com.atlassian.bitbucket.pull.PullRequest pullRequest, @Nonnull com.atlassian.bitbucket.scm.pull.PullRequestMergeCommandParameters parameters) -
tryMerge
@Nonnull com.atlassian.bitbucket.scm.Command<com.atlassian.bitbucket.pull.PullRequestMergeResult> tryMerge(@Nonnull com.atlassian.bitbucket.pull.PullRequest pullRequest) Attempt to merge the pull request to determine what the expected result of actually merging it would be. SCMs are not required to actually attempt the merge. Instead aresult
withUNKNOWN outcome
may be used to indicated that the merge was not attempted or some unexpected error occurred while attempting the merge.- Parameters:
pullRequest
- the pull request for which a dry run merge should be performed- Returns:
- a command which, when called, will return the result of attempting to merge the pull request
- Since:
- 5.0
-
updateRefs
@Nonnull default com.atlassian.bitbucket.scm.Command<Void> updateRefs(@Nonnull UpdatePullRequestRefsCommandParameters parameters) Implementors: The default implementation of this method will be removed in 9.0. SCMs are required to implement this command for themselves; they cannot rely on the default.- Parameters:
parameters
- provides the pull requests for which the pull request refs should be brought into sync with the current pull request state- Returns:
- a command which can be used to update the pull request refs synchronously or asynchronously
- Since:
- 7.12
-