4694: PatchError for a normal xsd file

Misery

What version are you running?

3.0.6

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

https://reviewboard/r/13321/diff/1/

What steps will reproduce the problem?

  1. Create a patch
  2. Create review request
  3. Show diff
  4. Error 500 on diff fragment - diff of xsd is missing!

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

A normal diff view with ALL fragments.

A completly weired screen. See screenshot.

What operating system are you using? What browser?

Linux, Firefox

Please provide any additional information below.

Traceback (most recent call last):

File "/opt/reviewboard/dist/lib/python2.7/site-packages/django/core/handlers/base.py", line 112, in get_response
response = wrapped_callback(request, callback_args, *callback_kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/django/views/decorators/cache.py", line 52, in _wrapped_view_func
response = view_func(request, args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/django/views/decorators/vary.py", line 19, in inner_func
response = func(args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/djblets/webapi/resources/base.py", line 243, in call
request, method, view, api_format=api_format, args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/reviewboard/webapi/base.py", line 338, in call_method_view
request, method, view, args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/djblets/webapi/resources/mixins/api_tokens.py", line 66, in call_method_view
request, method, view, args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/djblets/webapi/resources/mixins/oauth2_tokens.py", line 102, in call_method_view
request, method, view, args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/djblets/webapi/resources/base.py", line 368, in call_method_view
return view(request, args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/djblets/webapi/decorators.py", line 125, in _call
return view_func(args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/reviewboard/webapi/decorators.py", line 39, in _check
return view_func(args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/djblets/webapi/decorators.py", line 125, in _call
return view_func(args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/reviewboard/webapi/decorators.py", line 169, in _check
return view_func(args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/reviewboard/webapi/resources/filediff.py", line 389, in get
return self._get_diff_data(request, mimetype, args, *kwargs)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/reviewboard/webapi/resources/filediff.py", line 457, in _get_diff_data
populate_diff_chunks(files, highlighting, request=request)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/reviewboard/diffviewer/diffutils.py", line 772, in populate_diff_chunks
chunks = list(generator.get_chunks())

File "/opt/reviewboard/dist/lib/python2.7/site-packages/reviewboard/diffviewer/chunk_generator.py", line 786, in get_chunks
for chunk in super(DiffChunkGenerator, self).get_chunks(cache_key):

File "/opt/reviewboard/dist/lib/python2.7/site-packages/reviewboard/diffviewer/chunk_generator.py", line 107, in get_chunks
large_data=True)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/djblets/cache/backend.py", line 299, in cache_memoize
compress_large_data))

File "/opt/reviewboard/dist/lib/python2.7/site-packages/djblets/cache/backend.py", line 253, in cache_memoize_iter
items = items_or_callable()

File "/opt/reviewboard/dist/lib/python2.7/site-packages/djblets/cache/backend.py", line 296, in <lambda>
lambda: [lookup_callable()],

File "/opt/reviewboard/dist/lib/python2.7/site-packages/reviewboard/diffviewer/chunk_generator.py", line 106, in <lambda>
lambda: list(self.get_chunks_uncached()),

File "/opt/reviewboard/dist/lib/python2.7/site-packages/reviewboard/diffviewer/chunk_generator.py", line 793, in get_chunks_uncached
new = get_patched_file(old, self.filediff, self.request)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/reviewboard/diffviewer/diffutils.py", line 295, in get_patched_file
return patch(diff, buffer, filediff.dest_file, request)

File "/opt/reviewboard/dist/lib/python2.7/site-packages/reviewboard/diffviewer/diffutils.py", line 205, in patch
diff, rejects)

PatchError: The patch to "cslXXXXXXXXX/AlgorithmCatalog.xsd" did not apply cleanly.

misery
#1 misery

Ping

david
#2 david

Sorry for the delay here, this slipped our radar. We'd need to see the reject bundle to know what's going on. It would also be very helpful to know what SCM type this is, and how you created/posted you diff.

  • -New
    +NeedInfo
Misery
#3 Misery

Thanks for your reply.

I tried to reproduce it with an example. But I can see that the normalizing of line breaks seems the problem. A developer added a unix-line-break file and some "random lines" are switched to windows-line-break. But not the whole file. The review board switches both to unix-line-break and patch command is confused because there is nothing to patch.

Misery
#4 Misery

By the way... I cannot get the buttons of "Show rejects" and "Download patch reject bundle". The page is totally broken and do not display that.

Oh, and we are using Mercurial.

Misery
#5 Misery

Ok, we used our script for rbtools 0.7.11. Since we upgraded to 1.0.2 I cannot reproduce it. Hopefully it is fixed...