flake8
-
reviewboard/diffviewer/chunk_generator.py (Diff revision 1) Show all issues -
-
-
Review Request #10123 — Created Aug. 21, 2018 and submitted
Information | |
---|---|
brennie | |
Review Board | |
release-4.0.x | |
|
|
10124 | |
7e6d551... | |
Reviewers | |
reviewboard | |
Previously,
FileDiffs
for review requests with history would not show
cumulatively. That is, you would see only the result of applying that
FileDiff
, not the result of applying the entire stack ofFileDiffs
in the history graph.We now compute the entire file history, including deletions, and use
that to compute the cumulative diff. In other words, for a review
request with commitsA -> B -> C
where all three commits modify the
same file, previously you would see the result ofA
,B
, andC
independently. Now the diffviewer showsA
,A..B
, andA..C
.Files are still repeated (as indicated above) so this is not yet a true
cumulative diff. A future patch will update the diffviewer to only show
the leafFileDiffs
in the history graph.
Description | From | Last Updated |
---|---|---|
E501 line too long (86 > 79 characters) |
![]() |
|
E501 line too long (82 > 79 characters) |
![]() |
|
E501 line too long (91 > 79 characters) |
![]() |
|
E501 line too long (81 > 79 characters) |
![]() |
|
E501 line too long (81 > 79 characters) |
![]() |
|
E303 too many blank lines (2) |
![]() |
|
F401 'reviewboard.diffviewer.models.DiffSet' imported but unused |
![]() |
|
E303 too many blank lines (2) |
![]() |
|
E303 too many blank lines (2) |
![]() |
|
F811 redefinition of unused 'setUp' from line 2822 |
![]() |
|
F401 'reviewboard.diffviewer.models.DiffSet' imported but unused |
![]() |
|
E303 too many blank lines (2) |
![]() |
|
E303 too many blank lines (2) |
![]() |
|
Can you explicitly compare against 0? |
|
|
One blank line. |
|
|
Can you move the paren for the base_filediff stuff onto the next line, like: (newfile or (base_filediff is not None … |
|
|
You'll need to import range from six, or we get a list here on Python 2. |
|
|
Missing docstring. |
|
|
Missing docstring. |
|
|
Too many blank lines. |
|
|
Too many blank lines. |
|
|
We should compare in the returned order, not as a set, to catch future discrepencies. |
|
|
Since we're looping and asserting stuff in each loop, we should print out something to help identify the diff_file we're … |
|
|
This is indented 1 too many spaces. |
|
|
I personally find it more readable to do for i in reversed(range(len(ancestor_ids))). No biggie though. |
|
reviewboard/diffviewer/chunk_generator.py (Diff revision 1) |
---|
Testing Done: |
|
---|
Better architecture.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+290 -76) |
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+290 -76) |
Summary: |
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Testing Done: |
|
|||||||||
Commit: |
|
|||||||||
Diff: |
Revision 4 (+586 -234) |
reviewboard/diffviewer/tests/test_diffutils.py (Diff revision 4) |
---|
F401 'reviewboard.diffviewer.models.DiffSet' imported but unused
reviewboard/diffviewer/tests/test_diffutils.py (Diff revision 4) |
---|
F811 redefinition of unused 'setUp' from line 2822
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 5 (+585 -238) |
reviewboard/diffviewer/tests/test_diffutils.py (Diff revision 5) |
---|
F401 'reviewboard.diffviewer.models.DiffSet' imported but unused
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 6 (+582 -237) |
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 7 (+581 -237) |
Rebase
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 8 (+577 -233) |
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 9 (+578 -234) |
Add more unit tests
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 10 (+635 -234) |
reviewboard/diffviewer/diffutils.py (Diff revision 10) |
---|
Can you move the paren for the
base_filediff
stuff onto the next line, like:(newfile or (base_filediff is not None and ... ...)
reviewboard/diffviewer/models/filediff.py (Diff revision 10) |
---|
You'll need to import
range
fromsix
, or we get a list here on Python 2.
reviewboard/diffviewer/tests/test_diffutils.py (Diff revision 10) |
---|
We should compare in the returned order, not as a set, to catch future discrepencies.
reviewboard/diffviewer/tests/test_diffutils.py (Diff revision 10) |
---|
Since we're looping and asserting stuff in each loop, we should print out something to help identify the
diff_file
we're working on in case of assertion.
Addressed feedback.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 11 (+643 -235) |
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 12 (+643 -235) |
reviewboard/diffviewer/models/filediff.py (Diff revision 12) |
---|
I personally find it more readable to do
for i in reversed(range(len(ancestor_ids)))
. No biggie though.