511: Nearly-empty diff chunk causes diff viewer to fail

fen***@gmai***** (Google Code) (Is this you? Claim this profile.)
July 8, 2008
What steps will reproduce the problem?
1. Create a patch with no diff chunks, similar to:
diff -u foo.cpp
--- foo.cpp #1
+++ foo.cpp locally edited
diff -u bar.cpp
--- bar.cpp #2
+++ bar.cpp locally edited
@@ [ normal diff here]

We get this with our perforce integration, if we've edited foo.cpp but not
actually changed it.  (We have a different perforce back end because we
already had our own P4.py)
2. View /r/<n>/diff

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

Desired output is to not list foo.cpp as one of the modified files.
Acceptable output is to list foo.cpp with no diffs.
I see instead an exception, which includes:
Exception: The patch to 'foo.cpp' didn't apply cleanly. The temporary files
have been left in '/tmp/reviewboard.sthEh0' for debugging purposes.
`patch` returned: patch: **** Only garbage was found in the patch input.


What operating system are you using? What browser?

Fedora Core 6, Firefox.

Please provide any additional information below.
chipx86
#1 chipx86
How are you generating the diff?

post-review will filter these files out. Though we should handle this more gracefully
on Review Board. I have to say though that I haven't seen this problem in my tests.
Maybe it's a regression.
  • +NeedInfo
  • +Component-DiffViewer
david
#2 david
Basically the same as bug 438.
  • -NeedInfo
    +Duplicate
#3 fen***@gmai***** (Google Code) (Is this you? Claim this profile.)
The diff was updated by running a "show project diff" command, which generated the empty chunk, and 
uploading that with the "update diff" function.

I can't see any similarities between this and bug 438.