Skip patchset-level comments in diff view

Starting in Gerrit 3.3, comments can include a special file-id of
/PATCHSET_LEVEL and these comments have no code context, thus no
line numbers or related files. Skip these when enumerating comments
in diff view because there is no relevant context for them.

Thanks to Paul Fertser for reporting and debugging this problem.

Change-Id: I6505d08b62ba7ad8877561a82732889e142873c3
This commit is contained in:
Jeremy Stanley 2021-08-24 13:22:45 +00:00 committed by James E. Blair
parent 363114eb7a
commit 3e3964294c
1 changed files with 2 additions and 0 deletions

View File

@ -236,6 +236,8 @@ class BaseDiffView(urwid.WidgetWrap, mywid.Searchable):
comment_filenames = set()
for comment in new_comments:
path = comment.file.path
if path == '/PATCHSET_LEVEL': # patchset-level comments in 3.3
continue
if comment.parent:
if old_revision: # we're not looking at the base
continue