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: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Testing Done: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Commit: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 2 (+155 -11) |
-
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
-
Just a couple trivial style comments.
-
reviewboard/diffviewer/managers.py (Diff revision 2) These should fit on the same line and would make formatting nicer.
-
reviewboard/diffviewer/tests.py (Diff revision 2) Can you put the format operation outside of the parens around the whole string?
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+156 -11) |
-
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
-
reviewboard/diffviewer/tests.py (Diff revision 3) Col: 13 E131 continuation line unaligned for hanging indent
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 4 (+156 -11) |