Store the correct type for the new parent source information for FileDiffs.

Review Request #11155 — Created Sept. 1, 2020 and submitted

Information

Review Board
release-3.0.x

Reviewers

When calculating the new parent_source_filename and
parent_source_revision fields in FileDiff.extra_data to record
parent file information, we were storing the data using the types
extracted from the diff. This meant that we could get a byte string,
instead of a Unicode string, and it also meant that we could get a
Revision instance. These weren't safe to put in extra_data (the
former issue triggering errors on Review Board 4.0 on Python 3, and the
latter triggering errors when uploading a file introduced in a parent
diff).

We now force these to be strings instead when we're ready to store them.

Unit tests pass.

Posted a commit (combining this change with another upcoming change) that
introduced a new file in a parent diff. It posted correctly, instead of
erroring out with a "not serializable" error for the Revision.

Summary ID
Store the correct type for the new parent source information for FileDiffs.
When calculating the new `parent_source_filename` and `parent_source_revision` fields in `FileDiff.extra_data` to record parent file information, we were storing the data using the types extracted from the diff. This meant that we could get a byte string, instead of a Unicode string, and it also meant that we could get a `Revision` instance. These weren't safe to put in `extra_data` (the former issue triggering errors on Review Board 4.0 on Python 3, and the latter triggering errors when uploading a file introduced in a parent diff). We now force these to be strings instead when we're ready to store them.
6b72c7998ac520a4ebbbaf2a52051215f4a9b456
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-3.0.x (582a27c)