Package com.google.gerrit.server.change
Class RebaseChangeOp
java.lang.Object
com.google.gerrit.server.change.RebaseChangeOp
- All Implemented Interfaces:
BatchUpdateOp
,RepoOnlyOp
BatchUpdate operation that rebases a change.
Can only be executed in a BatchUpdate
set has a CodeReviewCommit.CodeReviewRevWalk
set as RevWalk
(set via BatchUpdate.setRepository(org.eclipse.jgit.lib.Repository, RevWalk, org.eclipse.jgit.lib.ObjectInserter)
).
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoid
Override this method to do something after the update e.g.setAllowConflicts
(boolean allowConflicts) Allows the rebase to succeed if there are conflicts.setCheckAddPatchSetPermission
(boolean checkAddPatchSetPermission) setCommitterIdent
(org.eclipse.jgit.lib.PersonIdent committerIdent) setDetailedCommitMessage
(boolean detailedCommitMessage) setFireRevisionCreated
(boolean fireRevisionCreated) setForceContentMerge
(boolean forceContentMerge) setMatchAuthorToCommitterDate
(boolean matchAuthorToCommitterDate) setMergeStrategy
(String strategy) setPostMessage
(boolean postMessage) setSendEmail
(boolean sendEmail) setStoreCopiedVotes
(boolean storeCopiedVotes) We always want to store copied votes except when the change is getting submitted and a new patch-set is created on submit (using submit strategies such as "REBASE_ALWAYS").setValidate
(boolean validate) setValidationOptions
(com.google.common.collect.ImmutableListMultimap<String, String> validationOptions) setVerifyNeedsRebase
(boolean verifyNeedsRebase) boolean
Override this method to modify a change.void
updateRepo
(RepoContext ctx) Override this method to update the repo.
-
Method Details
-
setCommitterIdent
@CanIgnoreReturnValue public RebaseChangeOp setCommitterIdent(org.eclipse.jgit.lib.PersonIdent committerIdent) -
setValidate
-
setCheckAddPatchSetPermission
@CanIgnoreReturnValue public RebaseChangeOp setCheckAddPatchSetPermission(boolean checkAddPatchSetPermission) -
setFireRevisionCreated
-
setForceContentMerge
-
setAllowConflicts
Allows the rebase to succeed if there are conflicts.This setting requires that
forceContentMerge
is settrue
. IfforceContentMerge
isfalse
this setting has no effect.- See Also:
-
setDetailedCommitMessage
-
setPostMessage
-
setStoreCopiedVotes
We always want to store copied votes except when the change is getting submitted and a new patch-set is created on submit (using submit strategies such as "REBASE_ALWAYS"). In such cases, we already store the votes of the new patch-sets in SubmitStrategyOp#saveApprovals. We should not also store the copied votes. -
setSendEmail
-
setMatchAuthorToCommitterDate
@CanIgnoreReturnValue public RebaseChangeOp setMatchAuthorToCommitterDate(boolean matchAuthorToCommitterDate) -
setValidationOptions
@CanIgnoreReturnValue public RebaseChangeOp setValidationOptions(com.google.common.collect.ImmutableListMultimap<String, String> validationOptions) -
setMergeStrategy
-
setVerifyNeedsRebase
-
updateRepo
public void updateRepo(RepoContext ctx) throws InvalidChangeOperationException, RestApiException, IOException, NoSuchChangeException, PermissionBackendException, DiffNotAvailableException Description copied from interface:RepoOnlyOp
Override this method to update the repo.- Specified by:
updateRepo
in interfaceRepoOnlyOp
- Parameters:
ctx
- context- Throws:
InvalidChangeOperationException
RestApiException
IOException
NoSuchChangeException
PermissionBackendException
DiffNotAvailableException
-
updateChange
public boolean updateChange(ChangeContext ctx) throws ResourceConflictException, IOException, BadRequestException Description copied from interface:BatchUpdateOp
Override this method to modify a change.- Specified by:
updateChange
in interfaceBatchUpdateOp
- Parameters:
ctx
- context- Returns:
- whether anything was changed that might require a write to the metadata storage.
- Throws:
ResourceConflictException
IOException
BadRequestException
-
postUpdate
Description copied from interface:RepoOnlyOp
Override this method to do something after the update e.g. send email or run hooks- Specified by:
postUpdate
in interfaceRepoOnlyOp
- Parameters:
ctx
- context
-
getRebasedCommit
-
getOriginalPatchSet
-
getPatchSetId
-
getPatchSet
-