SubmitStrategyOp: Set correct new revision in change-merged event

When using the cherry-pick submit strategy, and submitting a change with
identical tree, the branch does not advance. The change-merged event for
such a change has the new revision set to the change's sha1, which does
not actually exist in the repository. Instead it should be the sha1 of
the head of the (unchanged) branch.

When using any of the other submit strategies, and submitting multiple
changes in a single operation, the change-merged events emitted for the
implicitly merged changes have the new revision set to change's sha1.

Instead, they should have the new revision of the branch resulting from
the whole operation.

Bug: Issue 4193
Bug: Issue 4194
Change-Id: If41ea05e4c75ed8381b884238a46113ddd8c0b48
This commit is contained in:
David Pursehouse
2016-06-15 16:36:43 +09:00
parent 3e75e79c9d
commit 4668f1c61e
6 changed files with 1 additions and 27 deletions

View File

@@ -526,7 +526,7 @@ abstract class SubmitStrategyOp extends BatchUpdate.Op {
try {
args.hooks.doChangeMergedHook(updatedChange,
args.accountCache.get(submitter.getAccountId()).getAccount(),
mergedPatchSet, ctx.getDb(), mergeResultRev.name());
mergedPatchSet, ctx.getDb(), args.mergeTip.getCurrentTip().name());
} catch (OrmException ex) {
logError("Cannot run hook for submitted patch set " + getId(), ex);
}