Save filediffs in batches when creating a diffset.
Review Request #639 — Created May 12, 2017 and updated
When creating a diffset, we parse out each file and store a FileDiff for each one. These were being saved to the database one-at-a-time, which isn't efficient. Instead, we now create all the instances and then bulk-save them into the database, turning many SQL statements into one. We also no longer set the diff or parent diff immediately, since that triggers saving a RawFileDiffData. Instead, we set those only if we know we're saving. This will further speed up validation and prevent potentially unnecessary data from being stord in the database. A unit test has been added to ensure the SQL count is as expected. Other related tests have been updated to match the modern naming/docstring standards. Testing Done: Unit tests pass. Reviewed at https://reviews.reviewboard.org/r/8882/