Fix storing DiffX data when commits aren't used
Review Request #11769 — Created Aug. 3, 2021 and submitted
DiffXParserstores parsed information on a DiffX file in
FileDiff, and then uses that information to
regenerate the DiffX file.
The problem is, if a diff is uploaded without commit history (due to API
usage or SCM limitation), there is no
DiffCommit, so we were losing
out on all the change-related data and all associated files. This isn't
just an issue for DiffX, but any parser storing data in
FileDiffcreation now checks for this situation and stores any
ParsedDiffChange.extra_datacontent in a special key in
change_extra_datafor a main diff,
DiffXParserwill look for this and use it if commits
Unit tests pass on Python 2 and 3.
Verified that this fixed issues in production with non-commit-backed
- Fixed a line length issue.
- Removed an unused variable.
Revision 2 (+586 -48)
Checks run (2 succeeded)