1743: Weired Error occurred when the file has windows endline charactor.

Cynthi******@gmai***** (Google Code) (Is this you? Claim this profile.)
March 22, 2011
1166
I'm using review board 1.0.6, which is installed in Unbuntu. And I'm using perforce as the source manangement system. At the same time, I'm using post-review tool to post review request from a Window client on which installed Perforce client.

I have a file created from Windows and it contains Windows endline charactor. In Vim editer tool, this Win endline charator is show as "^M". When I do modification for this file and post review request using post-review, everything looks OK. But when I click "View Diff" button from review board web GUI, weired error occured, like this:

=========================
Diff currently unavailable.
Error: The patch to '//depot/playpen/b.txt' didn't apply cleanly. The temporary files have been left in '/tmp/reviewboard.76Xlcj' for debugging purposes. `patch` returned: patching file /tmp/reviewboard.76Xlcj/tmpOEenSn patch: **** malformed patch at line 8: fgg
Details

Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/ReviewBoard-1.0.6-py2.6.egg/reviewboard/diffviewer/views.py", line 214, in view_diff_fragment
    file = get_requested_diff_file()
  File "/usr/local/lib/python2.6/dist-packages/ReviewBoard-1.0.6-py2.6.egg/reviewboard/diffviewer/views.py", line 190, in get_requested_diff_file
    get_chunks)
  File "/usr/local/lib/python2.6/dist-packages/ReviewBoard-1.0.6-py2.6.egg/reviewboard/diffviewer/diffutils.py", line 623, in get_diff_files
    large_data=True)
  File "/usr/local/lib/python2.6/dist-packages/Djblets-0.5.9-py2.6.egg/djblets/util/misc.py", line 166, in cache_memoize
    data = lookup_callable()
  File "/usr/local/lib/python2.6/dist-packages/ReviewBoard-1.0.6-py2.6.egg/reviewboard/diffviewer/diffutils.py", line 622, in <lambda>
    enable_syntax_highlighting),
  File "/usr/local/lib/python2.6/dist-packages/ReviewBoard-1.0.6-py2.6.egg/reviewboard/diffviewer/diffutils.py", line 345, in get_chunks
    new = get_patched_file(old, filediff)
  File "/usr/local/lib/python2.6/dist-packages/ReviewBoard-1.0.6-py2.6.egg/reviewboard/diffviewer/diffutils.py", line 261, in get_patched_file
    return patch(filediff.diff, buffer, filediff.dest_file)
  File "/usr/local/lib/python2.6/dist-packages/ReviewBoard-1.0.6-py2.6.egg/reviewboard/diffviewer/diffutils.py", line 129, in patch
    (filename, tempdir, patch_output))
Exception: The patch to '//depot/playpen/b.txt' didn't apply cleanly. The temporary files have been left in '/tmp/reviewboard.76Xlcj' for debugging purposes.
`patch` returned: patching file /tmp/reviewboard.76Xlcj/tmpOEenSn
patch: **** malformed patch at line 8: fgg

======================

I attached the file that I'm using, please take a look.

Thanks
Cynthia Yu
testing xxxx
fgg
david
#1 david
Fundamentally the same as 1166.