Fix: Review comments do not show up for unchanged files
When comparing patch sets and some comment was put in one side,
that comment is not shown if there is not any code changed between
the two patch sets, Gerrit only say "No Differences", thus there's a
risk that this comment would been ignored.
Bug: issue 2122
Change-Id: Ib56475c2bc0114feffe64883708652baa7be9d1e
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/patches/AbstractPatchContentTable.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/patches/AbstractPatchContentTable.java
index 8de3251..12f8e62 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/patches/AbstractPatchContentTable.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/patches/AbstractPatchContentTable.java
@@ -242,7 +242,7 @@
}
protected boolean hasDifferences(PatchScript script) {
- return hasEdits(script) || hasMeta(script);
+ return hasEdits(script) || hasMeta(script) || hasComments(script);
}
public boolean isPureMetaChange(PatchScript script) {
@@ -259,6 +259,12 @@
return false;
}
+ // True if one of the two patch sets has comments
+ private boolean hasComments(PatchScript script) {
+ return !script.getCommentDetail().getCommentsA().isEmpty()
+ || !script.getCommentDetail().getCommentsB().isEmpty();
+ }
+
// True if this change is a mode change or a pure rename/copy
private boolean hasMeta(PatchScript script) {
return !script.getPatchHeader().isEmpty();