Option for SSHD review-cmd to always publish the message.

"--force-message" option for the SSHD review command,
which allows Gerrit to publish the "--message", even if the
labels could not be applied due to change being closed.

Used by some scripts/CI-systems, where the results (or links
to the result) are posted as a message after completion of a
build (often together with a label-change, indicating the
success of the build).

If the message is posted successfully, the cmd will return
successfully, even if the label could not be changed.

Change-Id: Ic2d5fc25ba97ddcedce832c7444e4f07512c761c
This commit is contained in:
Gustaf Lundh
2011-11-01 15:19:13 -07:00
committed by Shawn O. Pearce
parent 6cc0abd4ca
commit 1fbf2c28a0
4 changed files with 28 additions and 7 deletions

View File

@@ -100,6 +100,10 @@ public class ReviewCommand extends BaseCommand {
@Option(name = "--submit", aliases = "-s", usage = "submit the patch set")
private boolean submitChange;
@Option(name = "--force-message", usage = "publish the message, "
+ "even if the label score cannot be applied due to change being closed")
private boolean forceMessage = false;
@Inject
private ReviewDb db;
@@ -227,7 +231,7 @@ public class ReviewCommand extends BaseCommand {
}
try {
publishCommentsFactory.create(patchSetId, changeComment, aps).call();
publishCommentsFactory.create(patchSetId, changeComment, aps, forceMessage).call();
if (abandonChange) {
if (changeControl.canAbandon()) {