diff options
author | Tomas Ljunggren <tomas.ljunggren@tieto.com> | 2012-04-12 13:14:31 +0200 |
---|---|---|
committer | Tomas Ljunggren <tomas.ljunggren@tieto.com> | 2012-04-12 13:17:21 +0200 |
commit | e850dd17ab84eaab246793ed528f02ae13f53a57 (patch) | |
tree | f06ad8889e576c4e20eea1f62b11891e6d351f04 | |
parent | f617a647fbd4222812b99b42d84acf233d4f92b5 (diff) |
Don't send excess emails on integration successRC-QTQAINFRA-340-02
Task-number: QTQAINFRA-340
Change-Id: I55105f8d650a3ed5ae0795f349cf2fa204da3e2e
-rw-r--r-- | gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/StagingApprove.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/StagingApprove.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/StagingApprove.java index c0830c27c7..1beefb0bab 100644 --- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/StagingApprove.java +++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/StagingApprove.java @@ -243,7 +243,8 @@ public class StagingApprove extends BaseCommand { // Iterate through each open change and publish message. for (PatchSet patchSet : toApprove) { final PatchSet.Id patchSetId = patchSet.getId(); - publishMessage(patchSetId); + // Publish message but only send mail if not passed + publishMessage(patchSetId, !passed); if (passed) { // Set change status to merged. @@ -340,12 +341,12 @@ public class StagingApprove extends BaseCommand { } } - private void publishMessage(final PatchSet.Id patchSetId) + private void publishMessage(final PatchSet.Id patchSetId, final boolean sendMail) throws NoSuchChangeException, OrmException, NoSuchRefException, IOException, InvalidChangeOperationException { if (message != null && message.length() > 0) { publishCommentsFactory.create(patchSetId, message, - new HashSet<ApprovalCategoryValue.Id>(), false).call(); + new HashSet<ApprovalCategoryValue.Id>(), sendMail).call(); } } |