public abstract class SubmitStrategy
extends java.lang.Object
SubmitType
defines how the submitted commits should be
merged.Modifier and Type | Field and Description |
---|---|
protected com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments |
args |
Modifier and Type | Method and Description |
---|---|
protected abstract CodeReviewCommit |
_run(CodeReviewCommit mergeTip,
java.util.List<CodeReviewCommit> toMerge)
Runs this submit strategy.
|
abstract boolean |
dryRun(CodeReviewCommit mergeTip,
CodeReviewCommit toMerge)
Checks whether the given commit can be merged.
|
java.util.Map<com.google.gerrit.reviewdb.client.Change.Id,CodeReviewCommit> |
getNewCommits()
Returns all commits that have been newly created for the changes that are
getting merged.
|
org.eclipse.jgit.lib.PersonIdent |
getRefLogIdent()
Returns the PersonIdent that should be used for the ref log entries when
updating the destination branch.
|
boolean |
retryOnLockFailure()
Returns whether a merge that failed with
RefUpdate.Result.LOCK_FAILURE should be retried. |
CodeReviewCommit |
run(CodeReviewCommit mergeTip,
java.util.List<CodeReviewCommit> toMerge)
Runs this submit strategy.
|
protected void |
setRefLogIdent(com.google.gerrit.reviewdb.client.PatchSetApproval submitApproval)
Sets the ref log identity if it wasn't set yet.
|
protected final com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments args
public final CodeReviewCommit run(CodeReviewCommit mergeTip, java.util.List<CodeReviewCommit> toMerge) throws MergeException
mergeTip
- the mergeTiptoMerge
- the list of submitted commits that should be merged using
this submit strategyMergeException
protected abstract CodeReviewCommit _run(CodeReviewCommit mergeTip, java.util.List<CodeReviewCommit> toMerge) throws MergeException
mergeTip
- the mergeTiptoMerge
- the list of submitted commits that should be merged using
this submit strategyMergeException
public abstract boolean dryRun(CodeReviewCommit mergeTip, CodeReviewCommit toMerge) throws MergeException
mergeTip
- the mergeTiptoMerge
- the commit for which it should be checked whether it can be
merged or nottrue
if the given commit can be merged, otherwise
false
MergeException
public final org.eclipse.jgit.lib.PersonIdent getRefLogIdent()
run(CodeReviewCommit, List)
method finished.
Do only call this method after the run(CodeReviewCommit, List)
method has been invoked.null
public java.util.Map<com.google.gerrit.reviewdb.client.Change.Id,CodeReviewCommit> getNewCommits()
run(CodeReviewCommit, List)
method has been invoked.public boolean retryOnLockFailure()
RefUpdate.Result.LOCK_FAILURE
should be retried.
May be overwritten by subclasses.true
if a merge that failed with
RefUpdate.Result.LOCK_FAILURE
should be retried, otherwise
false
protected final void setRefLogIdent(com.google.gerrit.reviewdb.client.PatchSetApproval submitApproval)
submitApproval
- the approval that submitted the patch set