Fix the unified patch display to avoid showing duplicate comments

The backend service for the unified patch formatter combined a
comment into the output multiple times, rather than only for the
first time that side was shown in the diff.  By removing it from
the cache we only show it the first time the line occurs, which
is where the user would expect it to be.

Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2009-01-14 18:09:15 -08:00
parent b6de2cc972
commit 2711645183

View File

@@ -117,7 +117,7 @@ abstract class PatchDetailAction<T> implements Action<T> {
protected void addComments(final LineWithComments pLine,
final HashMap<Integer, List<PatchLineComment>>[] cache, final int side,
final int line) {
List<PatchLineComment> l = cache[side].get(line);
List<PatchLineComment> l = cache[side].remove(line);
if (l != null) {
for (final PatchLineComment c : l) {
pLine.addComment(c);