use of com.google.gerrit.entities.PatchSetInfo in project gerrit by GerritCodeReview.
the class TestChanges method incrementPatchSet.
public static void incrementPatchSet(Change change) {
PatchSet.Id curr = change.currentPatchSetId();
PatchSetInfo ps = new PatchSetInfo(PatchSet.id(change.getId(), curr != null ? curr.get() + 1 : 1));
ps.setSubject("Change subject");
change.setCurrentPatchSet(ps);
}
use of com.google.gerrit.entities.PatchSetInfo in project gerrit by GerritCodeReview.
the class PatchSetInfoFactory method get.
public PatchSetInfo get(Project.NameKey project, PatchSet patchSet) throws PatchSetInfoNotAvailableException {
try (Repository repo = repoManager.openRepository(project);
RevWalk rw = new RevWalk(repo)) {
RevCommit src = rw.parseCommit(patchSet.commitId());
PatchSetInfo info = get(rw, src, patchSet.id());
info.setParents(toParentInfos(src.getParents(), rw));
return info;
} catch (IOException | StorageException e) {
throw new PatchSetInfoNotAvailableException(e);
}
}
use of com.google.gerrit.entities.PatchSetInfo in project gerrit by GerritCodeReview.
the class PatchSetInfoFactory method get.
public PatchSetInfo get(RevWalk rw, RevCommit src, PatchSet.Id psi) throws IOException {
rw.parseBody(src);
PatchSetInfo info = new PatchSetInfo(psi);
info.setSubject(src.getShortMessage());
info.setMessage(src.getFullMessage());
info.setAuthor(emails.toUserIdentity(src.getAuthorIdent()));
info.setCommitter(emails.toUserIdentity(src.getCommitterIdent()));
info.setCommitId(src);
return info;
}
Aggregations