Fix extra period in comment message

This fixes the comment message, which contains an extra period when
pushing a patch set which is either rebased or commit message update.

Bug: Issue 4137
Change-Id: I4291c1f07601adc2250e70e998743ccd8e5a7c4a
This commit is contained in:
Khai Do
2016-07-18 15:04:07 -07:00
committed by David Pursehouse
parent c42ca4d5ac
commit ca55c005b9
3 changed files with 7 additions and 4 deletions

View File

@@ -351,6 +351,6 @@ public class ApprovalsUtil {
.append(LabelVote.create(e.getKey(), e.getValue()).format());
}
}
return msgs.append('.').toString();
return msgs.toString();
}
}

View File

@@ -1799,6 +1799,7 @@ public class ReceiveCommits {
ApprovalsUtil.renderMessageWithApprovals(
psId.get(), approvals,
Collections.<String, PatchSetApproval> emptyMap()));
msg.append('.');
if (!Strings.isNullOrEmpty(magicBranch.message)) {
msg.append("\n").append(magicBranch.message);
}

View File

@@ -263,10 +263,12 @@ public class ReplaceOp extends BatchUpdate.Op {
String approvalMessage = ApprovalsUtil.renderMessageWithApprovals(
patchSetId.get(), approvals, scanLabels(ctx, approvals));
StringBuilder message = new StringBuilder(approvalMessage);
String kindMessage = changeKindMessage(changeKind);
StringBuilder message = new StringBuilder(approvalMessage);
if (!Strings.isNullOrEmpty(kindMessage)) {
message.append(kindMessage);
} else {
message.append('.');
}
if (!Strings.isNullOrEmpty(reviewMessage)) {
message.append("\n").append(reviewMessage);
@@ -293,9 +295,9 @@ public class ReplaceOp extends BatchUpdate.Op {
case MERGE_FIRST_PARENT_UPDATE:
case TRIVIAL_REBASE:
case NO_CHANGE:
return ": Patch Set " + priorPatchSetId.get() + " was rebased";
return ": Patch Set " + priorPatchSetId.get() + " was rebased.";
case NO_CODE_CHANGE:
return ": Commit message was updated";
return ": Commit message was updated.";
case REWORK:
default:
return null;