use of com.google.gerrit.server.patch.DiffSummary in project gerrit by GerritCodeReview.
the class ChangeData method filePaths.
public List<String> filePaths(PatchSet ps) throws OrmException {
Integer psId = ps.getPatchSetId();
List<String> r = initFiles().get(psId);
if (r == null) {
Change c = change();
if (c == null) {
return null;
}
Optional<DiffSummary> p = getDiffSummary(c, ps);
if (!p.isPresent()) {
List<String> emptyFileList = Collections.emptyList();
if (lazyLoad) {
files.put(ps.getPatchSetId(), emptyFileList);
}
return emptyFileList;
}
r = p.get().getPaths();
files.put(psId, r);
}
return r;
}
use of com.google.gerrit.server.patch.DiffSummary in project gerrit by GerritCodeReview.
the class ChangeData method computeChangedLines.
private Optional<ChangedLines> computeChangedLines() throws OrmException {
Change c = change();
if (c == null) {
return Optional.empty();
}
PatchSet ps = currentPatchSet();
if (ps == null) {
return Optional.empty();
}
Optional<DiffSummary> ds = getDiffSummary(c, ps);
if (ds.isPresent()) {
return Optional.of(ds.get().getChangedLines());
}
return Optional.empty();
}
use of com.google.gerrit.server.patch.DiffSummary 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