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:
Dave Borowitz
2013-05-14 17:40:39 -07:00
parent b2249e90f9
commit 5989888aa6
2 changed files with 4 additions and 4 deletions

View File

@@ -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);