public interface

PluginPullRequestCommandFactory

com.atlassian.bitbucket.scm.pull.PluginPullRequestCommandFactory

Summary

Public Methods
@Nonnull Command<Void> bulkRescope(BulkRescopeCommandParameters parameters)
@Nonnull Command<Void> changes(PullRequest pullRequest, PullRequestChangeCommandParameters parameters, ChangeCallback callback)
@Nonnull Command<Void> commits(PullRequest pullRequest, CommitCallback callback)
@Nonnull Command<Void> delete(PullRequest pullRequest, PullRequestDeleteCommandParameters parameters)
Deletes repository data associated with the specified pull request.
@Nonnull Command<Void> diff(PullRequest pullRequest, PullRequestDiffCommandParameters parameters, DiffContentCallback callback)
@Nonnull Command<PullRequestEffectiveDiff> effectiveDiff(PullRequest pullRequest)
@Nonnull Command<Branch> merge(PullRequest pullRequest, PullRequestMergeCommandParameters parameters)
@Nonnull Command<PullRequestMergeResult> tryMerge(PullRequest pullRequest)
Attempt to merge the pull request to determine what the expected result of actually merging it would be.

Public Methods

@Nonnull public Command<Void> bulkRescope (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

@Nonnull public Command<Void> changes (PullRequest pullRequest, PullRequestChangeCommandParameters parameters, ChangeCallback callback)

@Nonnull public Command<Void> commits (PullRequest pullRequest, CommitCallback callback)

Parameters
pullRequest describes the refs being compared
callback a callback to receive commits which are unique to the from ref
Returns
  • a command which, when executed, will stream commits referenced by the from ref which are not referenced by the to ref

@Nonnull public Command<Void> delete (PullRequest pullRequest, PullRequestDeleteCommandParameters parameters)

Deletes repository data associated with the specified pull request.

SCMs must not delete the from or to 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 delete
parameters parameters providing context for the deleted pull request
Returns
  • a command which, when executed, will delete the specified pull request, releasing any artifacts, such as refs or objects, that are associated with it

@Nonnull public Command<Void> diff (PullRequest pullRequest, PullRequestDiffCommandParameters parameters, DiffContentCallback callback)

@Nonnull public Command<PullRequestEffectiveDiff> effectiveDiff (PullRequest pullRequest)

@Nonnull public Command<Branch> merge (PullRequest pullRequest, PullRequestMergeCommandParameters parameters)

@Nonnull public Command<PullRequestMergeResult> tryMerge (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 a result with UNKNOWN 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 to test for merge-ability
Returns
  • the result of trying to merge the pull request