Fix parent diffs with moved files
Review Request #7440 — Created June 19, 2015 and submitted
Previously, if a parent diff contained a moved file without
modifications, it was possible that the associatedFileDiff
could end
up with incorrect source revisions and would not display correctly.
When a parent diff only contains a move, we no longer apply it because
it will not affect the content and thepatch
executable will exit
with an error (as it believe there is only garbage in the patch). This
has been fixed and diffs with moves in the parent diff display
correctly.Unit tests have been added for two cases:
- the case where the parent diff has both a modification and rename;
and - the case where the parent diff has only a rename.
Ran unit tests. The new unit test that covers a parent diff with only
a rename failed without this patch applied.
- Change Summary:
-
More unit tests. Fix logic for parent containing only a move.
- Summary:
-
[WIP] Fix parent diffs with moved filesFix parent diffs with moved files
- Description:
-
~ If a parent diff contains a moved file with modifications, it was
~ previously possible that FileDiff
s could end up with incorrect source~ revisions and diffs would not display correctly. When a parent diff ~ only contains a move, we do not apply it because it will not affect the ~ content and the patch
executable will complain that there is only~ garbage in the input. This results in patches displaying correctly when ~ their parent diff is only a moved file. ~ Previously, if a parent diff contained a moved file without
~ modifications, it was possible that the associated FileDiff
could end~ up with incorrect source revisions and would not display correctly. ~ When a parent diff only contains a move, we no longer apply it because ~ it will not affect the content and the patch
executable will exit~ with an error (as it believe there is only garbage in the patch). This ~ has been fixed and diffs with moves in the parent diff display + correctly. ~ A unit test has been added to ensure this behaviour does not regress.
~ Unit tests have been added for two cases:
+ + - the case where the parent diff has both a modification and rename;
and
+ - the case where the parent diff has only a rename.
- the case where the parent diff has both a modification and rename;
- Testing Done:
-
~ Ran unit tests. The provided unit test failed without this patch
~ applied. ~ Ran unit tests. The new unit test that covers a parent diff with only
~ a rename failed without this patch applied. - Commit:
-
1f985f98cd2cab9a0926a2c9ede97533674e8692
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/managers.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/managers.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/managers.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/managers.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py
-