Merge "Fix RebaseIfNecessary submit strategy" into stable-2.6
This commit is contained in:
@@ -41,6 +41,7 @@ import com.google.gerrit.server.patch.PatchSetInfoFactory;
|
|||||||
import com.google.gerrit.server.project.ChangeControl;
|
import com.google.gerrit.server.project.ChangeControl;
|
||||||
import com.google.gerrit.server.project.InvalidChangeOperationException;
|
import com.google.gerrit.server.project.InvalidChangeOperationException;
|
||||||
import com.google.gerrit.server.project.NoSuchChangeException;
|
import com.google.gerrit.server.project.NoSuchChangeException;
|
||||||
|
import com.google.gerrit.server.project.ProjectCache;
|
||||||
import com.google.gwtorm.server.AtomicUpdate;
|
import com.google.gwtorm.server.AtomicUpdate;
|
||||||
import com.google.gwtorm.server.OrmException;
|
import com.google.gwtorm.server.OrmException;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
@@ -74,6 +75,7 @@ public class RebaseChange {
|
|||||||
private final ChangeHookRunner hooks;
|
private final ChangeHookRunner hooks;
|
||||||
private final ApprovalsUtil approvalsUtil;
|
private final ApprovalsUtil approvalsUtil;
|
||||||
private final MergeUtil.Factory mergeUtilFactory;
|
private final MergeUtil.Factory mergeUtilFactory;
|
||||||
|
private final ProjectCache projectCache;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
RebaseChange(final ChangeControl.Factory changeControlFactory,
|
RebaseChange(final ChangeControl.Factory changeControlFactory,
|
||||||
@@ -83,7 +85,8 @@ public class RebaseChange {
|
|||||||
final GitReferenceUpdated gitRefUpdated,
|
final GitReferenceUpdated gitRefUpdated,
|
||||||
final RebasedPatchSetSender.Factory rebasedPatchSetSenderFactory,
|
final RebasedPatchSetSender.Factory rebasedPatchSetSenderFactory,
|
||||||
final ChangeHookRunner hooks, final ApprovalsUtil approvalsUtil,
|
final ChangeHookRunner hooks, final ApprovalsUtil approvalsUtil,
|
||||||
final MergeUtil.Factory mergeUtilFactory) {
|
final MergeUtil.Factory mergeUtilFactory,
|
||||||
|
final ProjectCache projectCache) {
|
||||||
this.changeControlFactory = changeControlFactory;
|
this.changeControlFactory = changeControlFactory;
|
||||||
this.patchSetInfoFactory = patchSetInfoFactory;
|
this.patchSetInfoFactory = patchSetInfoFactory;
|
||||||
this.db = db;
|
this.db = db;
|
||||||
@@ -94,6 +97,7 @@ public class RebaseChange {
|
|||||||
this.hooks = hooks;
|
this.hooks = hooks;
|
||||||
this.approvalsUtil = approvalsUtil;
|
this.approvalsUtil = approvalsUtil;
|
||||||
this.mergeUtilFactory = mergeUtilFactory;
|
this.mergeUtilFactory = mergeUtilFactory;
|
||||||
|
this.projectCache = projectCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -377,8 +381,8 @@ public class RebaseChange {
|
|||||||
"Change %s was modified", change.getId()));
|
"Change %s was modified", change.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
final LabelTypes labelTypes = changeControlFactory.controlFor(change)
|
final LabelTypes labelTypes =
|
||||||
.getLabelTypes();
|
projectCache.get(change.getProject()).getLabelTypes();
|
||||||
approvalsUtil.copyVetosToPatchSet(db, labelTypes,
|
approvalsUtil.copyVetosToPatchSet(db, labelTypes,
|
||||||
change.currentPatchSetId());
|
change.currentPatchSetId());
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user