Package com.google.gerrit.server.change
Class RebaseChangeOp
- java.lang.Object
-
- com.google.gerrit.server.change.RebaseChangeOp
-
- All Implemented Interfaces:
BatchUpdateOp
,RepoOnlyOp
public class RebaseChangeOp extends Object implements BatchUpdateOp
BatchUpdate operation that rebases a change.Can only be executed in a
BatchUpdate
set has aCodeReviewCommit.CodeReviewRevWalk
set asRevWalk
(set viaBatchUpdate.setRepository(org.eclipse.jgit.lib.Repository, RevWalk, org.eclipse.jgit.lib.ObjectInserter)
).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
RebaseChangeOp.Factory
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PatchSet
getPatchSet()
PatchSet.Id
getPatchSetId()
CodeReviewCommit
getRebasedCommit()
void
postUpdate(PostUpdateContext ctx)
Override this method to do something after the update e.g.RebaseChangeOp
setAllowConflicts(boolean allowConflicts)
Allows the rebase to succeed if there are conflicts.RebaseChangeOp
setCheckAddPatchSetPermission(boolean checkAddPatchSetPermission)
RebaseChangeOp
setCommitterIdent(org.eclipse.jgit.lib.PersonIdent committerIdent)
RebaseChangeOp
setDetailedCommitMessage(boolean detailedCommitMessage)
RebaseChangeOp
setFireRevisionCreated(boolean fireRevisionCreated)
RebaseChangeOp
setForceContentMerge(boolean forceContentMerge)
RebaseChangeOp
setMatchAuthorToCommitterDate(boolean matchAuthorToCommitterDate)
RebaseChangeOp
setPostMessage(boolean postMessage)
RebaseChangeOp
setSendEmail(boolean sendEmail)
RebaseChangeOp
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").RebaseChangeOp
setValidate(boolean validate)
boolean
updateChange(ChangeContext ctx)
Override this method to modify a change.void
updateRepo(RepoContext ctx)
Override this method to update the repo.
-
-
-
Method Detail
-
setCommitterIdent
public RebaseChangeOp setCommitterIdent(org.eclipse.jgit.lib.PersonIdent committerIdent)
-
setValidate
public RebaseChangeOp setValidate(boolean validate)
-
setCheckAddPatchSetPermission
public RebaseChangeOp setCheckAddPatchSetPermission(boolean checkAddPatchSetPermission)
-
setFireRevisionCreated
public RebaseChangeOp setFireRevisionCreated(boolean fireRevisionCreated)
-
setForceContentMerge
public RebaseChangeOp setForceContentMerge(boolean forceContentMerge)
-
setAllowConflicts
public RebaseChangeOp setAllowConflicts(boolean allowConflicts)
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:
setForceContentMerge(boolean)
-
setDetailedCommitMessage
public RebaseChangeOp setDetailedCommitMessage(boolean detailedCommitMessage)
-
setPostMessage
public RebaseChangeOp setPostMessage(boolean postMessage)
-
setStoreCopiedVotes
public RebaseChangeOp 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"). 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
public RebaseChangeOp setSendEmail(boolean sendEmail)
-
setMatchAuthorToCommitterDate
public RebaseChangeOp setMatchAuthorToCommitterDate(boolean matchAuthorToCommitterDate)
-
updateRepo
public void updateRepo(RepoContext ctx) throws MergeConflictException, InvalidChangeOperationException, RestApiException, IOException, NoSuchChangeException, PermissionBackendException
Description copied from interface:RepoOnlyOp
Override this method to update the repo.- Specified by:
updateRepo
in interfaceRepoOnlyOp
- Parameters:
ctx
- context- Throws:
MergeConflictException
InvalidChangeOperationException
RestApiException
IOException
NoSuchChangeException
PermissionBackendException
-
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
public void postUpdate(PostUpdateContext ctx)
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
public CodeReviewCommit getRebasedCommit()
-
getPatchSetId
public PatchSet.Id getPatchSetId()
-
getPatchSet
public PatchSet getPatchSet()
-
-