use of com.google.gerrit.server.data.PatchAttribute in project gerrit by GerritCodeReview.
the class EventFactory method addPatchSetFileNames.
public void addPatchSetFileNames(PatchSetAttribute patchSetAttribute, Change change, PatchSet patchSet) {
try {
PatchList patchList = patchListCache.get(change, patchSet);
for (PatchListEntry patch : patchList.getPatches()) {
if (patchSetAttribute.files == null) {
patchSetAttribute.files = new ArrayList<>();
}
PatchAttribute p = new PatchAttribute();
p.file = patch.getNewName();
p.fileOld = patch.getOldName();
p.type = patch.getChangeType();
p.deletions -= patch.getDeletions();
p.insertions = patch.getInsertions();
patchSetAttribute.files.add(p);
}
} catch (PatchListNotAvailableException e) {
log.warn("Cannot get patch list", e);
}
}
Aggregations