3965: View diff fails for C/C++ files from unified CVS diff

Boris.*******@gmai***** (Google Code) (Is this you? Claim this profile.)
What version are you running?
Review Board 2.0.18

What's the URL of the page containing the problem?
http://vmreviewboard.dsa-ac.de/r/22/diff/1#index_header

What steps will reproduce the problem?
1. Upload unified diff with C/C++ implementation and header files
2. View diff

What is the expected output? What do you see instead?
Expected is a diff for C/C++ files but instead only an error is shown. Non C/C++ files from the same diff file (Makefile, ini files, ...) are shown correctly.

What operating system are you using? What browser?
Fedora 20, Chrome 45.0.2454.85

Please provide any additional information below.

----------
The patch to 'app/tester/dtm/src/dtmmain.cpp' didn't apply cleanly. The temporary files have been left in '/tmp/reviewboard.UtdaSy' for debugging purposes.
`patch` returned: 

     This may be a bug in the software, a temporary outage, or an issue
     with the format of your diff.

     Please try again, and if you still have trouble,
     contact support.

    Details
   
    Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/reviewboard/diffviewer/views.py", line 265, in get
    response = renderer.render_to_response(request)
  File "/usr/lib/python2.7/site-packages/reviewboard/diffviewer/renderers.py", line 56, in render_to_response
    return HttpResponse(self.render_to_string(request))
  File "/usr/lib/python2.7/site-packages/reviewboard/diffviewer/renderers.py", line 74, in render_to_string
    large_data=True)
  File "/usr/lib/python2.7/site-packages/djblets/cache/backend.py", line 111, in cache_memoize
    data = lookup_callable()
  File "/usr/lib/python2.7/site-packages/reviewboard/diffviewer/renderers.py", line 73, in <lambda>
    lambda: self.render_to_string_uncached(request),
  File "/usr/lib/python2.7/site-packages/reviewboard/diffviewer/renderers.py", line 87, in render_to_string_uncached
    request=request)
  File "/usr/lib/python2.7/site-packages/reviewboard/diffviewer/diffutils.py", line 422, in populate_diff_chunks
    chunks = generator.get_chunks()
  File "/usr/lib/python2.7/site-packages/reviewboard/diffviewer/chunk_generator.py", line 156, in get_chunks
    large_data=True)
  File "/usr/lib/python2.7/site-packages/djblets/cache/backend.py", line 111, in cache_memoize
    data = lookup_callable()
  File "/usr/lib/python2.7/site-packages/reviewboard/diffviewer/chunk_generator.py", line 155, in <lambda>
    lambda: list(self._get_chunks_uncached()),
  File "/usr/lib/python2.7/site-packages/reviewboard/diffviewer/chunk_generator.py", line 163, in _get_chunks_uncached
    new = get_patched_file(old, self.filediff, self.request)
  File "/usr/lib/python2.7/site-packages/reviewboard/diffviewer/diffutils.py", line 232, in get_patched_file
    return patch(diff, buffer, filediff.dest_file, request)
  File "/usr/lib/python2.7/site-packages/reviewboard/diffviewer/diffutils.py", line 168, in patch
    'output': stderr,
Exception: The patch to 'app/tester/dtm/src/dtmmain.cpp' didn't apply cleanly. The temporary files have been left in '/tmp/reviewboard.UtdaSy' for debugging purposes.
`patch` returned: 
-------

The files in the tmp folder have not been created.
#1 Boris.*******@gmai***** (Google Code) (Is this you? Claim this profile.)
Correction Fedora version is 21.
chipx86
#2 chipx86

How was the diff generated and posted? Can you go through the exact steps?

  • -New
    +NeedInfo
#3 bboehlen

Further investigation shows that the issue with C/C++ code only appears if the diff is created based on two CVS revisions. If the diff is created based on local changes against HEAD, the diff is shown fine for C/C++ files.

The patch between the revisions has been created as a unified diff. I'll try to get the correct command.

#4 bboehlen

Diff has been created with
cvs diff -bu -r dtm_2_7_2 -r dtm_2_7_3 > dtm_272_273_diff.txt

Afterwards it has been uploaded as a review request for the CVS server the patch has been created against. Except C/C++ files all diffs are shown okay (eg Makefiles).