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

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

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.

Commits

Files

    Loading...