3422: Diff-viewer crash when viewing difference between diffs with deleted files.

stuar******@gmai***** (Google Code) (Is this you? Claim this profile.)
June 17, 2014
2818
What version are you running?

1.7.22

What's the URL of the page containing the problem?

/reviews/r/500/diff/1-2/

What steps will reproduce the problem?
1. Create a review request with a diff that deletes several files in a subversion repository and modifies one file.
2. Upload a second diff, that also deletes the same files, but modifies the modified file differently.
3. Look at the delta between diff 1 and 2.

What is the expected output? What do you see instead?

Expected output:

No changes between diff 1 and 2 for the deleted files, because they're deleted in both diffs. Only difference should be the different modifications of the one modified file.

Actual output:

The modified file is displayed correctly. But, for every deleted file, there is this error and traceback:

Diff currently unavailable.
Error: list index out of range

Details

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/ReviewBoard-1.7.22-py2.6.egg/reviewboard/diffviewer/views.py", line 251, in view_diff_fragment
    diff_file = get_requested_diff_file()
  File "/usr/lib/python2.6/site-packages/ReviewBoard-1.7.22-py2.6.egg/reviewboard/diffviewer/views.py", line 171, in get_requested_diff_file
    populate_diff_chunks(files, highlighting, request=request)
  File "/usr/lib/python2.6/site-packages/ReviewBoard-1.7.22-py2.6.egg/reviewboard/diffviewer/diffutils.py", line 344, in populate_diff_chunks
    chunks = generator.get_chunks()
  File "/usr/lib/python2.6/site-packages/ReviewBoard-1.7.22-py2.6.egg/reviewboard/diffviewer/chunk_generator.py", line 137, in get_chunks
    large_data=True)
  File "/usr/lib/python2.6/site-packages/Djblets-0.7.28-py2.6.egg/djblets/util/misc.py", line 157, in cache_memoize
    data = lookup_callable()
  File "/usr/lib/python2.6/site-packages/ReviewBoard-1.7.22-py2.6.egg/reviewboard/diffviewer/chunk_generator.py", line 136, in <lambda>
    lambda: list(self._get_chunks_uncached()),
  File "/usr/lib/python2.6/site-packages/ReviewBoard-1.7.22-py2.6.egg/reviewboard/diffviewer/chunk_generator.py", line 261, in _get_chunks_uncached
    yield self._new_chunk(lines, 0, num_lines, False, tag, meta)
  File "/usr/lib/python2.6/site-packages/ReviewBoard-1.7.22-py2.6.egg/reviewboard/diffviewer/chunk_generator.py", line 363, in _new_chunk
    compute_chunk_last_header(lines, num_lines, meta, self._last_header)
  File "/usr/lib/python2.6/site-packages/ReviewBoard-1.7.22-py2.6.egg/reviewboard/diffviewer/chunk_generator.py", line 526, in compute_chunk_last_header
    line = lines[0]
IndexError: list index out of range


What operating system are you using? What browser?

Linux. Firefox.

Please provide any additional information below.
david
#1 david
This is fixed in the 2.0 series.