Package com.google.gerrit.server.change
Class PatchSetInserter
java.lang.Object
com.google.gerrit.server.change.PatchSetInserter
- All Implemented Interfaces:
BatchUpdateOp
,RepoOnlyOp
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionPatchSetInserter
(PermissionBackend permissionBackend, ApprovalsUtil approvalsUtil, ChangeMessagesUtil cmUtil, PatchSetInfoFactory patchSetInfoFactory, ChangeKindCache changeKindCache, CommitValidators.Factory commitValidatorsFactory, EmailNewPatchSet.Factory emailNewPatchSetFactory, PatchSetUtil psUtil, RevisionCreated revisionCreated, ProjectCache projectCache, WorkInProgressStateChanged wipStateChanged, AutoMerger autoMerger, TopicValidator topicValidator, DiffOperationsForCommitValidation.Factory diffOperationsForCommitValidationFactory, ChangeNotes notes, PatchSet.Id psId, org.eclipse.jgit.lib.ObjectId commitId) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Override this method to do something after the update e.g.setAllowClosed
(boolean allowClosed) setCheckAddPatchSetPermission
(boolean checkAddPatchSetPermission) setDescription
(String description) setFireRevisionCreated
(boolean fireRevisionCreated) setMessage
(String message) 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) setWorkInProgress
(boolean workInProgress) boolean
Override this method to modify a change.void
updateRepo
(RepoContext ctx) Override this method to update the repo.
-
Constructor Details
-
PatchSetInserter
@Inject public PatchSetInserter(PermissionBackend permissionBackend, ApprovalsUtil approvalsUtil, ChangeMessagesUtil cmUtil, PatchSetInfoFactory patchSetInfoFactory, ChangeKindCache changeKindCache, CommitValidators.Factory commitValidatorsFactory, EmailNewPatchSet.Factory emailNewPatchSetFactory, PatchSetUtil psUtil, RevisionCreated revisionCreated, ProjectCache projectCache, WorkInProgressStateChanged wipStateChanged, AutoMerger autoMerger, TopicValidator topicValidator, DiffOperationsForCommitValidation.Factory diffOperationsForCommitValidationFactory, ChangeNotes notes, PatchSet.Id psId, org.eclipse.jgit.lib.ObjectId commitId)
-
-
Method Details
-
getPatchSetId
-
setMessage
-
setDescription
-
setWorkInProgress
-
setValidate
-
setCheckAddPatchSetPermission
@CanIgnoreReturnValue public PatchSetInserter setCheckAddPatchSetPermission(boolean checkAddPatchSetPermission) -
setGroups
-
setValidationOptions
@CanIgnoreReturnValue public PatchSetInserter setValidationOptions(com.google.common.collect.ImmutableListMultimap<String, String> validationOptions) -
setFireRevisionCreated
-
setAllowClosed
-
setSendEmail
-
setTopic
-
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. -
getChange
-
getPatchSet
-
updateRepo
public void updateRepo(RepoContext ctx) throws AuthException, ResourceConflictException, IOException, PermissionBackendException Description copied from interface:RepoOnlyOp
Override this method to update the repo.- Specified by:
updateRepo
in interfaceRepoOnlyOp
- Parameters:
ctx
- context- Throws:
AuthException
ResourceConflictException
IOException
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
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
-