Add utilities to compare DiffCommits and FileDiffs for equivalence

Review Request #8313 — Created July 28, 2016 and submitted — Latest diff uploaded

Information

Review Board
dvcs

Reviewers

Two FileDiffs are equivalent if and only if they have the same diff
content (including headers). Instead of directly comparing the diff
contents we can instead see that they point at the same
RawFileDiffData object, as any two identical FileDiffs must have
identical RawFileDiffData instances.

Two DiffCommits are equivalent if and only if they have the same
author, committer, and diff contents. That is, every FileDiff in
DiffCommit A will have a corresponding equivalent Filediff in
DiffCommit B if A and B are equivalent. We cache the result of this
comparison in the extra_data of each DiffCommit to save future
database queries.

Ran unit tests.

    Loading...