use of com.google.gerrit.server.patch.DiffSummaryKey in project gerrit by GerritCodeReview.
the class ChangeData method getDiffSummary.
private Optional<DiffSummary> getDiffSummary() {
if (diffSummary == null) {
if (!lazyload()) {
return Optional.empty();
}
Change c = change();
PatchSet ps = currentPatchSet();
if (c == null || ps == null || !loadCommitData()) {
return Optional.empty();
}
PatchListKey pk = PatchListKey.againstBase(ps.commitId(), parentCount);
DiffSummaryKey key = DiffSummaryKey.fromPatchListKey(pk);
try {
diffSummary = Optional.of(patchListCache.getDiffSummary(key, c.getProject()));
} catch (PatchListNotAvailableException e) {
diffSummary = Optional.empty();
}
}
return diffSummary;
}
use of com.google.gerrit.server.patch.DiffSummaryKey in project gerrit by GerritCodeReview.
the class PostReview method getAffectedFilePaths.
private Set<String> getAffectedFilePaths(RevisionResource revision) throws PatchListNotAvailableException {
ObjectId newId = revision.getPatchSet().commitId();
DiffSummaryKey key = DiffSummaryKey.fromPatchListKey(PatchListKey.againstDefaultBase(newId, Whitespace.IGNORE_NONE));
DiffSummary ds = patchListCache.getDiffSummary(key, revision.getProject());
return new HashSet<>(ds.getPaths());
}
Aggregations