Enhance the diff file attachment resource a bit.

Review Request #13603 — Created March 4, 2024 and submitted — Latest diff uploaded


Review Board


This change makes two enhancements to the diff file attachment resource.

First, a new source_file argument allows uploading a file for the source
version of the FileDiff. In most cases we can allow the server to fetch
it from the repository, but in the case where there's a parent diff, the
uploading client needs to provide both the source and modified versions.

Second, I did run into a case where I successfully uploaded two files
for the same FileDiff, which caused errors later on. A new API error has
been added for this case.

  • Ran unit tests.
  • Posted binary file changes that used a parent diff and successfully
    uploaded both the source and modified versions.