Rich Dougherty rd.nz

Review Board error with Subversion diff

Review Board 1.6.6 chokes on some diffs generated by Subversion 1.7.4. The error given is:

The file ‘https://path-to-file-in-repo' could not be found in the repository

The problem seems to be with files that have been copied from elsewhere in the repository and then modified. Subversion generates a diff to show the changes to the file. Unfortunately Review Board doesn’t realise the diff is taken against a file in a different location.

The diff is generated with the svn diff and produces a header like this:

Index: path/to/file
===================================================================
--- path/to/file (working copy)
+++ path/to/file (working copy)

The solution is to tell Subversion to pretend the file is newly added by using the --show-copies-as-adds option. With this option a different header is produced:

Index: path/to/file
===================================================================
--- path/to/file (revision 0)
+++ path/to/file (working copy)

Review Board accepts diffs created with this option without any problems. A downside is that some of the file history is missing for the reviewer.

Note: I didn’t try using the post-review tool, which I think is the recommended way to generate diffs for Review Board.