com.atlassian.bitbucket.scm.pull.RepositoryRescopeContext |
Provides a context for SCMs to perform rescope calculations and update affected pull requests when a repository is updated.
Rescoping candidates are accessed by iterating over the context. The candidates are guaranteed to:
Decline
: If the source
or
target
ref for the pull request has been removed, the SCM shall
mark the pull request as declined
Merge
: If the source
or
target
ref for the pull request has been updated in such a way that
there are no commits on the source that are not also on the target, the SCM shall mark the pull request
as merged
source
ref may result in it referencing the same commit as the target
ref,
or one of its ancestors, effectively making the pull request "merged"Update
: If new commits have been added to the
source
or target
refs, the
SCM shall update the pull request with the new hashes
pull request
in the context may have exactly one operation performed on it.
Additionally, only pull requests
retrieved from the context may be provided back
to it for declining
, merging
or
updating
.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Marks the pull request as
declined . | |||||||||||
Marks the pull request as
remotely merged . | |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
java.lang.Iterable
|
Marks the pull request as declined
.
pullRequest | the pull request to decline |
---|
IllegalArgumentException | if the provided pullRequest was not returned by this context
|
---|
Marks the pull request as remotely merged
.
When a pull request is remotely merged, the SCM is not required to detect the commit which actually carried out the merge. It is only required to detect that the pull request's refs have changed in a way which removes all of the pull request's incoming commits.
pullRequest | the pull request to mark as merged |
---|
IllegalArgumentException | if the provided pullRequest was not returned by this context
|
---|
Updates the commit
s for the pull request's
from
and
to
refs to the hashes from their current
tips in the repository.
Both hashes are required, but either one may be identical to its ref's existing value. If both hashes match the existing values the SCM should not call this method.
pullRequest | the pull request for which refs should be updated |
---|---|
newFromHash | the hash for the current tip of the from ref |
newToHash | the hash for the current tip of the to ref |
IllegalArgumentException | if the provided pullRequest was not returned by this context
|
---|