Notedb: Unify subject and patch set handling

When inserting patch sets, pass in a RevWalk along with the commit
SHA-1 so we can ensure the body is parsed. Set the subject implicitly
when we add a new patch set; always do this, even if the subject
matches the previous subject.

When parsing patch sets, we have to still parse the subject separately
from the patch set, since there is no subject field on PatchSet. But
we can use a single setter on Change to set the current patch set ID,
subject, and original subject together as a batch, rather than going
through PatchSetInfo.

Change-Id: If37c4990e2e5888d5e87bd5c34a821e59186ab6d
This commit is contained in:
Dave Borowitz
2016-01-22 11:31:38 -05:00
parent 79419f4b39
commit 5dd9c1ac98
15 changed files with 158 additions and 123 deletions

View File

@@ -2273,7 +2273,7 @@ public class ReceiveCommits {
boolean draft = magicBranch != null && magicBranch.draft;
newPatchSet = psUtil.insert(
db, update, psId, newCommit, draft, newGroups,
db, state.rw, update, psId, newCommit, draft, newGroups,
rp.getPushCertificate() != null
? rp.getPushCertificate().toTextWithSignature()
: null);