Fix "List index out of range" errors with interdiffing deleted files.
Review Request #6473 — Created Oct. 20, 2014 and submitted
It's possible to hit an IndexError when processing an interdiff between two
changes that delete a file. The wrinkle here is that between the two revisions
of the diff, some additional changes to that file were made (and synced to the
local developer's tree).The result of this is that we didn't filter out the file from the list of
things to show for the interdiff, and then things went wrong when we tried to
process the opcodes for diffing two empty strings.While I was doing this, I saw some warnings about a unicode-unaware comparison
occurring, so I've slipped the fix for that in as well. This doesn't actually
have any correctness implications, it just speeds up things slightly when
dealing with empty files.
- Created a reproduction case for the bug and tested before and after the
change. Before, I saw an entry for this file with the error inside. After,
the deleted files don't show up at all in the interdiff. - Ran unit tests.
Description | From | Last Updated |
---|---|---|
Col: 17 E201 whitespace after '(' |
reviewbot | |
Every Python linter complains about this format, and it's just not common in Python. Can we go back to the … |
chipx86 | |
Col: 17 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 17 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 22 E201 whitespace after '(' |
reviewbot | |
Col: 22 E128 continuation line under-indented for visual indent |
reviewbot | |
What happens for legitimately empty files? Do we want to do this just for interdiffs? Also, can we add a … |
chipx86 |
- Commit:
-
2301e26f2c23ce76166f13372332fa270e9a359c9830ce5597089c224accda8879c49ad3ba0811ee
- Diff:
-
Revision 2 (+7 -5)
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/diffutils.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/diffutils.py
- Change Summary:
-
Cover a couple more cases.
- Commit:
-
9830ce5597089c224accda8879c49ad3ba0811eedc18c41a57db0ee6c035de42e9ba1b8323a326be
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/diffutils.py
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/diffutils.py Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/diffviewer/diffutils.py
- Change Summary:
-
Revert changes to chunk_generator.py
- Commit:
-
d6a8205b7aca6e77719bbbc691f2e61ad94bf5d262eb03356bd97f957cd3601dc8500ee6f10aa628
- Diff:
-
Revision 5 (+9 -7)