Provide a way to lock patch sets
Add a new function type that provides a way to prevent new patch sets from being added to a change. Defining a label with this function and applying a +1 vote with that label onto a change will stop: 1) new patch upload, 2) rebase, and 3) abandon. Like NoBlock/NoOp, its value will never affect submittability. Change-Id: Ib0d81d85e797f522d80da8c474a711ec5021f4b6
This commit is contained in:
@@ -1966,7 +1966,7 @@ public class ReceiveCommits {
|
||||
}
|
||||
}
|
||||
|
||||
boolean validate(boolean autoClose) throws IOException {
|
||||
boolean validate(boolean autoClose) throws IOException, OrmException {
|
||||
if (!autoClose && inputCommand.getResult() != NOT_ATTEMPTED) {
|
||||
return false;
|
||||
} else if (change == null) {
|
||||
@@ -1989,8 +1989,12 @@ public class ReceiveCommits {
|
||||
}
|
||||
|
||||
changeCtl = projectControl.controlFor(change);
|
||||
if (!changeCtl.canAddPatchSet()) {
|
||||
reject(inputCommand, "cannot replace " + ontoChange);
|
||||
if (!changeCtl.canAddPatchSet(db)) {
|
||||
String locked = ".";
|
||||
if (changeCtl.isPatchSetLocked(db)) {
|
||||
locked = ". Change is patch set locked.";
|
||||
}
|
||||
reject(inputCommand, "cannot replace " + ontoChange + locked);
|
||||
return false;
|
||||
} else if (change.getStatus().isClosed()) {
|
||||
reject(inputCommand, "change " + ontoChange + " closed");
|
||||
|
Reference in New Issue
Block a user