From c9fde1981b7233e1bc93daaa26957a4932d8ce05 Mon Sep 17 00:00:00 2001 From: Edwin Kempin Date: Tue, 10 Nov 2015 13:59:57 -0800 Subject: [PATCH] Notedb: Fix change message on submit of whole topic When notedb was enabled the change message about the submit did not include the submitter when a whole topic was submitted together. This was because the SUBMIT label which was applied to the change to record the submitter was not visible from the change notes yet, because they were not reloaded yet. We already reload the changes notes later to get the update about the submitter, just do this reload a bit earlier. This fixes the tests for submitting a whole topic when notedb is enabled. Change-Id: I5e33aa1bd5b9c9cb8502f0cdde9b2f0250d39090 Signed-off-by: Edwin Kempin --- .../main/java/com/google/gerrit/server/git/MergeOp.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/git/MergeOp.java b/gerrit-server/src/main/java/com/google/gerrit/server/git/MergeOp.java index 26c5f3b13a..05e0ceccc9 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/git/MergeOp.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/git/MergeOp.java @@ -860,6 +860,9 @@ public class MergeOp { // If mergeTip is null merge failed and mergeResultRev will not be read. ObjectId mergeResultRev = mergeTip != null ? mergeTip.getMergeResults().get(commit) : null; + // The change notes must be forcefully reloaded so that the SUBMIT + // approval that we added earlier is visible + commit.notes().reload(); try { ChangeMessage msg; switch (s) { @@ -981,9 +984,7 @@ public class MergeOp { PatchSet.Id mergedId = commit.change().currentPatchSetId(); merged = db.patchSets().get(mergedId); c = setMergedPatchSet(c.getId(), mergedId); - // The change notes must be forcefully reloaded so that the SUBMIT - // approval that we added earlier is visible - submitter = approvalsUtil.getSubmitter(db, commit.notes().reload(), mergedId); + submitter = approvalsUtil.getSubmitter(db, commit.notes(), mergedId); ChangeControl control = commit.getControl(); update = updateFactory.create(control, c.getLastUpdatedOn());