1792: post-review fails to upload diff with only binary files modified

dmitry.mu*********@gmai***** (Google Code) (Is this you? Claim this profile.)
Sept. 24, 2012
2660
What version are you running?
1.0.9

What steps will reproduce the problem?
1. Add new binary file to SVN repository
2. Commit it
3. Create diff using svnlook diff -r 2 $REPOS
4. Upload diff using post-review --diff-filename=$DIFF_FILE

Expected result: upload successfull, UI says that some binary file was added (as it does if using post-review --revision-range=1:2)

Actual result: Error message: 
The generated diff file was empty. This usually means no files were
modified in this change.

Diff-file content:
Added: trunk/mail4.jar
===================================================================
(Binary files differ)


Property changes on: trunk/mail4.jar
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Environment:

Ubuntu 10.4
SVN 1.6.6dfsg-2ubuntu1

If post-review run with --debug option:

Error uploading diff

The generated diff file was empty. This usually means no files were
modified in this change.

Try running with --output-diff and --debug for more information.

>>> svn info file:///home/raketa/SVN-Test
>>> diff --version
>>> repository info: Path: file:///home/raketa/SVN-Test, Base path: /, Supports changesets: False
>>> Looking for 'localhost /' cookie in .post-review-cookies.txt
>>> Cookie file loaded, but no cookie for this server
==> Review Board Login Required
Enter username and password for Review Board at http://localhost/
>>> Logging in with username "admin"
>>> HTTP POSTing to http://localhost/api/json/accounts/login/: {'username': 'admin', 'password': '**************'}
>>> Logged in.
>>> HTTP GETting /api/json/repositories/
>>> HTTP GETting /api/json/repositories/1/info/
>>> repository info: Path: file:///home/raketa/SVN-Test, Base path: /, Supports changesets: False
>>> Attempting to create review request on file:///home/raketa/SVN-Test for None
>>> Submitting the review request as raketa
>>> HTTP POSTing to http://localhost/api/json/reviewrequests/new/: {'repository_path': u'file:///home/raketa/SVN-Test', 'submit_as': 'raketa'}
>>> Review request created
>>> Attempting to set field 'target_groups' to 'Test' for review request '56'
>>> HTTP POSTing to http://localhost/api/json/reviewrequests/56/draft/set/: {'target_groups': 'Test'}
>>> Attempting to set field 'summary' to 'abc' for review request '56'
>>> HTTP POSTing to http://localhost/api/json/reviewrequests/56/draft/set/: {'summary': 'abc'}
>>> Attempting to set field 'description' to 'Revision 91' for review request '56'
>>> HTTP POSTing to http://localhost/api/json/reviewrequests/56/draft/set/: {'description': 'Revision 91'}
>>> Uploading diff, size: 272
>>> HTTP POSTing to http://localhost/api/json/reviewrequests/56/diff/new/: {'basedir': '/'}
>>> Got API Error 105 (HTTP code 200): One or more fields had errors
>>> Error data: {u'fields': {u'path': [u'The diff file is empty']}, u'stat': u'fail', u'err': {u'msg': u'One or more fields had errors', u'code': 105}}
Your review request still exists, but the diff is not attached.
david
#1 david
  • +Component-RBTools
#2 jira*****@gmai***** (Google Code) (Is this you? Claim this profile.)
It appears as though the problem is caused by svn. From what I've read, svn does not support binary diffs (they only support text). There is a way to get around this though:

If you try to do an > svn diff binary.bin you will probably get a Cannot display error.

First set an editor so you can edit the file's svn properties.

> export EDITOR=yourPreferredEditor

You can take a look at the properties file with:

> svn propedit svn:mime-type binary.bin

And delete the svn:mime-type property with:

> svn propdel svn:mime-type binary.bin

Then you should be able to get a diff using svn diff binary.bin (svn now thinks it is a text file).
chipx86
#3 chipx86
Old bug, but there's a lot of activity on bug 2660, which is the primary cause, so moving it there.