Start factoring out PatchSet accesses into a PatchSetUtil class

Replaces the simplest get calls in most callers that didn't require
substantial refactoring. Doesn't actually read notedb yet because
there is no notedb support for patch sets yet.

Change-Id: I7ef198dd1257b833a3a4b21180f5012f6fdc56d4
This commit is contained in:
Dave Borowitz
2016-01-14 15:00:59 -05:00
parent 5d926ca2ba
commit 3ecfd76674
43 changed files with 365 additions and 183 deletions

View File

@@ -46,7 +46,8 @@ public class GetContent implements RestReadView<FileResource> {
OrmException {
String path = rsrc.getPatchKey().get();
if (Patch.COMMIT_MSG.equals(path)) {
String msg = changeUtil.getMessage(rsrc.getRevision().getChange());
String msg = changeUtil.getMessage(
rsrc.getRevision().getChangeResource().getNotes());
return BinaryResult.create(msg)
.setContentType(FileContentUtil.TEXT_X_GERRIT_COMMIT_MESSAGE)
.base64();