Move ChangeMessage out of transaction during cherry-pick
In the case of CherryPickChange, the ChangeMessage does not belong to the same change, so it cannot be in a transaction against the same root key. This applies to both the new patch set insertion and new change creation code paths. Change-Id: Iae76682a45ec327fef6af25422e459ffd4557e05
This commit is contained in:
@@ -70,13 +70,13 @@ public class ChangeInserter {
|
||||
ChangeUtil.updateTrackingIds(db, change, trackingFooters, commit.getFooterLines());
|
||||
approvalsUtil.addReviewers(db, labelTypes, change, ps, info, reviewers,
|
||||
Collections.<Account.Id> emptySet());
|
||||
if (changeMessage != null) {
|
||||
db.changeMessages().insert(Collections.singleton(changeMessage));
|
||||
}
|
||||
db.commit();
|
||||
} finally {
|
||||
db.rollback();
|
||||
}
|
||||
if (changeMessage != null) {
|
||||
db.changeMessages().insert(Collections.singleton(changeMessage));
|
||||
}
|
||||
|
||||
gitRefUpdated.fire(change.getProject(), ps.getRefName(), ObjectId.zeroId(),
|
||||
commit);
|
||||
|
||||
Reference in New Issue
Block a user