public interface

PluginPullRequestCommandFactory

com.atlassian.bitbucket.scm.pull.PluginPullRequestCommandFactory

Summary

Public Methods
@Nonnull Command<Void> bulkRescope(BulkRescopeCommandParameters parameters)
@Nonnull @Deprecated Command<Boolean> canMerge(PullRequest pullRequest)
This method is deprecated. in 4.10 for removal in 5.0. Use tryMerge(PullRequest) instead.
@Nonnull Command<Void> changes(PullRequest pullRequest, PullRequestChangeCommandParameters parameters, ChangeCallback callback)
@Nonnull Command<Void> commits(PullRequest pullRequest, CommitCallback callback)
@Nonnull Command<Void> diff(PullRequest pullRequest, PullRequestDiffCommandParameters parameters, DiffContentCallback callback)
@Nonnull Command<PullRequestEffectiveDiff> effectiveDiff(PullRequest pullRequest)
@Nonnull Command<Branch> merge(PullRequest pullRequest, PullRequestMergeCommandParameters parameters)
@Deprecated @Nonnull Command<Void> rescope(RepositoryRescopeCommandParameters parameters)
This method is deprecated. since 4.5, to be removed in 5.0. SCMs should implement bulkRescope(BulkRescopeCommandParameters) instead. SCMs that implement bulkRescope do not have to implement this method anymore.
@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 providies 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 @Deprecated public Command<Boolean> canMerge (PullRequest pullRequest)

This method is deprecated.
in 4.10 for removal in 5.0. Use tryMerge(PullRequest) instead.

@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> diff (PullRequest pullRequest, PullRequestDiffCommandParameters parameters, DiffContentCallback callback)

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

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

@Deprecated @Nonnull public Command<Void> rescope (RepositoryRescopeCommandParameters parameters)

This method is deprecated.
since 4.5, to be removed in 5.0. SCMs should implement bulkRescope(BulkRescopeCommandParameters) instead. SCMs that implement bulkRescope do not have to implement this method anymore.

Parameters
parameters describes the repository and ref changes, as well as providing a context for the command to use to retrieve affected pull requests and apply updates
Returns
  • a command which, when called, will rescope any pull requests affected by ref changes in the specified repository

@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. NOTE: A default implementation is provided which determines the outcome using the canMerge(PullRequest) call. However as of 5.0 SCMs will be required to provide their own implementation.

Parameters
pullRequest the pull request to test for merge-ability
Returns
  • the result of trying to merge the pull request