Allow commit histories that modify the same file more than once
Review Request #7043 — Created March 11, 2015 and submitted
Previously, when uploading a commit history to a review request, it was
impossible for your commit history to contain two commits which
modified the same file. This is because theFileDiff
processing
checked the repository for the previous revisions of all files. In this
case, the repository would report that the file did not exist at the
given revision and validation would fail.Now we can check for file existence within our current set of uploaded
DiffCommit
s. If we are unable to find an ancestorDiffCommit
that
contains the file at the correct revision, we fall back to the old
behaviour of querying the repository. This allows linear commit
histories that modify the same file to be validated and uploaded.NB: The diffviewer will not be able to show the
FileDiff
for such
DiffSet
s. This will be addressed in a later patch that will land
before this one.
Ran unit tests.
Posted a review request with commit history that modified the same file
in two different commits; it was successful.Tried to view the review request's diff in the diff viewer; it was
unsuccesful.
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/models.py reviewboard/diffviewer/managers.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/models.py reviewboard/diffviewer/managers.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py