Show squashed diffs in the diffviewer
Review Request #7135 — Created March 28, 2015 and submitted
Previously we would show multiple
FileDiff
s for the same file in the
diff viewer if the file was modified in multiple commits. Now we
determine whatFileDiff
s are ancestors of otherFileDiff
s in the
commit history and filter out all the ancestors. The result is a
squashed diff between the original file and the resulting file.
Ran unit tests.
Manually verified that the squashed diffs were correct.
Still able to view the
FileDiff
s of review requests without
commit history.
Description | From | Last Updated |
---|---|---|
Col: 12 E111 indentation is not a multiple of four |
reviewbot | |
We should probably just import logging at the top of the file. |
david | |
This should use exc_info=True (we have =1 elsewhere, but I'm slowly cleaning that up). |
david | |
I think I liked your approach up above of changing all of these to add the - and the beginning … |
david | |
Unindent. |
brennie | |
"In this case" twice is awkward phrasing. |
brennie | |
diffviewer.commitutils before diffviewer.differ |
david | |
Blank line after this. |
david | |
This should also have a '-' |
david | |
Can you maybe describe this option in the docstring above? |
chipx86 | |
Does not check if there is a diff_commit. |
brennie | |
This has the potential to be cheaper by doing: self.filediff.diff_commit_id. Reduces the possibility of a lookup. |
chipx86 | |
Alignment is inconsistent between these. |
chipx86 | |
Maybe flesh this out a bit so its description stands alone without needing to know more of the architecture as … |
chipx86 | |
Can you use a list comprehension instead of map? They're generally easier to read and are faster, since they don't … |
chipx86 | |
Since this code is all basically the same as the above, we should factor this out into another function. |
chipx86 | |
Does not check if there is a diff_commit |
brennie | |
As above, we should use diff_commit_id here instead. |
chipx86 | |
No need for six.text_type anymore. |
chipx86 | |
Col: 5 E303 too many blank lines (2) |
reviewbot | |
local variable 'have_interdiffset_commits' is assigned to but never used |
reviewbot | |
"FileDiffs" and "DiffSet". |
chipx86 | |
Looks like we're doing this twice now? |
chipx86 |
- Summary:
-
[WIP] Do not show duplicate files in DiffViewerShow squashed diffs in the diffviewer
- Description:
-
~ Previously we would show multiple
FileDiff
s for the same file in the diff viewer if the file was modified in multiple commits. Now we determine whatFileDiff
s are ancestors of otherFileDiff
s in the commit history and filter out all the ancestors.~ Previously we would show multiple
FileDiff
s for the same file in the diff viewer if the file was modified in multiple commits. Now we determine whatFileDiff
s are ancestors of otherFileDiff
s in the commit history and filter out all the ancestors. The result is a squashed diff between the original file and the resulting file.- - TODO: Show correct source file and revision. It currently only shows the previous source file and revision.
- Testing Done:
-
+ Ran unit tests.
+ + Manually verified that the squashed diffs were correct.
- Commit:
-
f5955cc199fb706a4e1f472297c8ad083922c290fc09644ddbe85164826249ee3f046a89afba1404
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/renderers.py reviewboard/diffviewer/models.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py reviewboard/diffviewer/views.py reviewboard/diffviewer/commitutils.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/renderers.py reviewboard/diffviewer/models.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py reviewboard/diffviewer/views.py reviewboard/diffviewer/commitutils.py
-
- Change Summary:
-
wrap description
- Description:
-
~ Previously we would show multiple
FileDiff
s for the same file in the diff viewer if the file was modified in multiple commits. Now we determine whatFileDiff
s are ancestors of otherFileDiff
s in the commit history and filter out all the ancestors. The result is a squashed diff between the original file and the resulting file.~ Previously we would show multiple
FileDiff
s for the same file in the+ diff viewer if the file was modified in multiple commits. Now we + determine what FileDiff
s are ancestors of otherFileDiff
s in the+ commit history and filter out all the ancestors. The result is a + squashed diff between the original file and the resulting file.
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/renderers.py reviewboard/diffviewer/models.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py reviewboard/diffviewer/views.py reviewboard/diffviewer/commitutils.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/renderers.py reviewboard/diffviewer/models.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py reviewboard/diffviewer/views.py reviewboard/diffviewer/commitutils.py
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/renderers.py reviewboard/diffviewer/models.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py reviewboard/diffviewer/views.py reviewboard/diffviewer/commitutils.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/renderers.py reviewboard/diffviewer/models.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py reviewboard/diffviewer/views.py reviewboard/diffviewer/commitutils.py
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/renderers.py reviewboard/diffviewer/models.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py reviewboard/diffviewer/views.py reviewboard/diffviewer/commitutils.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/renderers.py reviewboard/diffviewer/models.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py reviewboard/diffviewer/views.py reviewboard/diffviewer/commitutils.py
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/renderers.py reviewboard/diffviewer/models.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py reviewboard/diffviewer/views.py reviewboard/diffviewer/commitutils.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/renderers.py reviewboard/diffviewer/models.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py reviewboard/diffviewer/views.py reviewboard/diffviewer/commitutils.py
- Change Summary:
-
Turn off cumulative diffing if there is not history.
- Testing Done:
-
Ran unit tests.
Manually verified that the squashed diffs were correct.
+ + Still able to view the
FileDiff
s of review requests without+ commit history. - Commit:
-
4b94c2e41f08018c7e43a5e4b3f556774257e1b0bf89fe1530eb1ec8db737d24804c3c3e06e67f55
-
-
-
This has the potential to be cheaper by doing:
self.filediff.diff_commit_id
. Reduces the possibility of a lookup. -
-
Maybe flesh this out a bit so its description stands alone without needing to know more of the architecture as a whole.
-
Can you use a list comprehension instead of
map
? They're generally easier to read and are faster, since they don't require the extra function calls. -
Since this code is all basically the same as the above, we should factor this out into another function.
-
-
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/renderers.py reviewboard/diffviewer/models.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py reviewboard/diffviewer/views.py reviewboard/diffviewer/commitutils.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/renderers.py reviewboard/diffviewer/models.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py reviewboard/diffviewer/views.py reviewboard/diffviewer/commitutils.py
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/renderers.py reviewboard/diffviewer/models.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py reviewboard/diffviewer/views.py reviewboard/diffviewer/commitutils.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/renderers.py reviewboard/diffviewer/models.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py reviewboard/diffviewer/views.py reviewboard/diffviewer/commitutils.py
-
-
- Change Summary:
-
PEP8
- Commit:
-
5ca8f82367a7eeb83d3c393fd2d9b3ed580821dc098fec9d421c77d4a1e97ec467758155ac4bcbb1
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/renderers.py reviewboard/diffviewer/models.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py reviewboard/diffviewer/views.py reviewboard/diffviewer/commitutils.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/renderers.py reviewboard/diffviewer/models.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py reviewboard/diffviewer/views.py reviewboard/diffviewer/commitutils.py
- Change Summary:
-
Address Christian's issues.
- Commit:
-
098fec9d421c77d4a1e97ec467758155ac4bcbb1af9f90812602244307588e61bb2153c13c5cd823
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/renderers.py reviewboard/diffviewer/models.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py reviewboard/diffviewer/views.py reviewboard/diffviewer/commitutils.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/renderers.py reviewboard/diffviewer/models.py reviewboard/diffviewer/tests.py reviewboard/diffviewer/diffutils.py reviewboard/diffviewer/views.py reviewboard/diffviewer/commitutils.py