use of com.google.gerrit.reviewdb.client.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)) {
final RevCommit src = rw.parseCommit(ObjectId.fromString(patchSet.getRevision().get()));
PatchSetInfo info = get(rw, src, patchSet.getId());
info.setParents(toParentInfos(src.getParents(), rw));
return info;
} catch (IOException e) {
throw new PatchSetInfoNotAvailableException(e);
}
}
use of com.google.gerrit.reviewdb.client.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(new PatchSet.Id(change.getId(), curr != null ? curr.get() + 1 : 1));
ps.setSubject("Change subject");
change.setCurrentPatchSet(ps);
}
Aggregations