Package com.google.gerrit.server.submit
Class SubmitStrategy
- java.lang.Object
-
- com.google.gerrit.server.submit.SubmitStrategy
-
- Direct Known Subclasses:
CherryPick
,FastForwardOnly
,MergeAlways
,MergeIfNecessary
,RebaseSubmitStrategy
public abstract class SubmitStrategy extends Object
Base class that submit strategies must extend.A submit strategy for a certain
SubmitType
defines how the submitted commits should be merged.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addOps(BatchUpdate bu, Set<CodeReviewCommit> toMerge)
Add operations to a batch update that execute this submit strategy.protected abstract List<com.google.gerrit.server.submit.SubmitStrategyOp>
buildOps(Collection<CodeReviewCommit> toMerge)
com.google.common.collect.ImmutableMap<Change.Id,Change>
getUpdatedChanges()
Returns the updated changed after this submit strategy has been executed.static com.google.inject.Module
module()
-
-
-
Method Detail
-
module
public static com.google.inject.Module module()
-
getUpdatedChanges
public com.google.common.collect.ImmutableMap<Change.Id,Change> getUpdatedChanges()
Returns the updated changed after this submit strategy has been executed.- Returns:
- the updated changes after this submit strategy has been executed
-
addOps
public final void addOps(BatchUpdate bu, Set<CodeReviewCommit> toMerge) throws IntegrationException
Add operations to a batch update that execute this submit strategy.Guarantees exactly one op is added to the update for each change in the input set.
- Parameters:
bu
- batch update to add operations to.toMerge
- the set of submitted commits that should be merged using this submit strategy. Implementations are responsible for ordering of commits, and will not modify the input in place.- Throws:
IntegrationException
- if an error occurred initializing the operations (as opposed to an error during execution, which will be reported only when the batch update executes the operations).
-
buildOps
protected abstract List<com.google.gerrit.server.submit.SubmitStrategyOp> buildOps(Collection<CodeReviewCommit> toMerge) throws IntegrationException
- Throws:
IntegrationException
-
-