- Change Summary:
-
Add handling of deleted empty files in Git diffs, and change the background color of new empty file diffs.
- Summary:
-
Add better handling of new files with no content in Git diffs.Add better support for added and deleted 0-length files in Git diffs.
- Description:
-
~ New files with no content were not included in the diffs of review requests.
~ This was especially troublesome when we needed to add an empty __init__.py
~ file, for example. ~ The addition and deletion of 0-length files were not included in the diffs of
~ review requests. This was especially troublesome when we needed to add or ~ delete an empty __init__.py
file, for example.~ This change adds support for including new empty files in review requests for
~ Git only. Specifically, these new empty files will be displayed with the text ~ This change adds support for including new and deleted empty files in review
~ requests for Git only. New empty files will be displayed with the text "This is an empty file." (see the attached screenshots). - Testing Done:
-
I used both rbt post and the "New Review Request" page to create review
requests with different Git diffs: - Diff with 1 new empty file - Diff with 2 new empty files - Diff with 1 new empty file, 1 new non-empty file ~ - Diff with 1 new empty file, 2 modified files ~ - Diff with 1 new empty file, 2 modified files + - Diff with 1 deleted empty file + - Diff with 1 deleted empty file, 1 modified file + - Diff with 1 deleted empty file, 1 deleted non-empty file, 1 modified file After this change, the 3 unit tests that tested parsing a Git diff with a new
~ empty file failed (since a new empty file is now included, the number of files ~ from parse() has increased by 1). ~ empty file failed. (Since a new empty file is now included, the number of files ~ from parse() has increased by 1.) ~ After updating the unit tests to reflect this change, all unit tests pass.
~ After updating the 3 unit tests to reflect this change, all unit tests pass.
+ The 2 new unit tests that test the deletion of empty files also pass. - Commit:
-
9795eab19eda5f54d5b438a75b6dba0bf9cc66aea4b74d2e9b03aeb16ceae1cb63f7c53d7245891d
- Diff:
-
Revision 2 (+186 -56)
- Removed Files:
- Added Files:
Add better support for added and deleted empty files.
Review Request #5785 — Created May 8, 2014 and submitted
The addition and deletion of 0-length files were not included in the diffs of
review requests. This was especially troublesome when we needed to add or
delete an empty__init__.py
file, for example.This change adds support for including new and deleted empty files in review
requests for Git, SVN, Mercurial, and Perforce. New empty files will be
displayed with the text "This is an empty file.", and deleted empty files will
be displayed with the text "This empty file was deleted. The content cannot be
displayed." (see the attached screenshots).
I used rbt post and the "New Review Request" page to create review
requests with different Git diffs, and rbt post for SVN, Mercurial, and
Perforce diffs:
- Diff with 1 new empty file
- Diff with 2 new empty files
- Diff with 1 new empty file, 1 new non-empty file
- Diff with 1 new empty file, 2 modified files
- Diff with 1 deleted empty file
- Diff with 1 deleted empty file, 1 modified file
- Diff with 1 deleted empty file, 1 deleted non-empty file, 1 modified fileAfter this change, the 3 unit tests that tested parsing a Git diff with a new
empty file failed. (Since a new empty file is now included, the number of files
from parse() has increased by 1.)After updating the 3 unit tests to reflect this change, all unit tests pass.
The new unit tests also pass.
Description | From | Last Updated |
---|---|---|
Can we re-indent this a bit? if (self.filediff.binary or self.filediff.deleted or self.filediff.source_revision == '' or (self.filediff.is_new and counts['insert_count'] == 0 … |
david | |
I think this would be easier to read if we rearranged it a little bit: if (empty_change and file_info.origInfo != … |
david | |
It would be nice to mention if this is a deleted empty file. |
david | |
This should go into SVNDiffParser (reviewboard/scmtools/svn/__init.py__) so that this behavior doesn't interfere with diffs from other SCMs. |
david | |
Col: 13 E129 visually indented line with same indent as next logical line |
reviewbot | |
redefinition of unused 'Client' from line 19 |
reviewbot | |
Col: 13 E129 visually indented line with same indent as next logical line |
reviewbot | |
redefinition of unused 'Client' from line 19 |
reviewbot |
-
-
Can we re-indent this a bit?
if (self.filediff.binary or self.filediff.deleted or self.filediff.source_revision == '' or (self.filediff.is_new and counts['insert_count'] == 0 and counts['delete_count'] == 0)):
-
I think this would be easier to read if we rearranged it a little bit:
if (empty_change and file_info.origInfo != PRE_CREATION and not (file_info.moved or file_info.copied or file_info.deleted)):
-
- Description:
-
The addition and deletion of 0-length files were not included in the diffs of
review requests. This was especially troublesome when we needed to add or delete an empty __init__.py
file, for example.This change adds support for including new and deleted empty files in review
requests for Git only. New empty files will be displayed with the text ~ "This is an empty file." (see the attached screenshots). ~ "This is an empty file.", and deleted empty files will be displayed with the + text "This empty file was deleted. The content cannot be displayed." (see + the attached screenshots). - Commit:
-
a4b74d2e9b03aeb16ceae1cb63f7c53d7245891dd789b37ec82110020d50eaab676a70ebdc4f9b2b
- Diff:
-
Revision 3 (+195 -58)
- Removed Files:
- Added Files:
- Change Summary:
-
Add support for SVN diffs.
- Summary:
-
Add better support for added and deleted 0-length files in Git diffs.Add better support for added and deleted 0-length files in Git and SVN diffs.
- Description:
-
The addition and deletion of 0-length files were not included in the diffs of
review requests. This was especially troublesome when we needed to add or delete an empty __init__.py
file, for example.This change adds support for including new and deleted empty files in review
~ requests for Git only. New empty files will be displayed with the text ~ requests for Git and SVN. New empty files will be displayed with the text "This is an empty file.", and deleted empty files will be displayed with the text "This empty file was deleted. The content cannot be displayed." (see the attached screenshots). - Testing Done:
-
~ I used both rbt post and the "New Review Request" page to create review
~ requests with different Git diffs: ~ I used rbt post and the "New Review Request" page to create review
~ requests with different Git diffs, and rbt post for SVN diffs: - Diff with 1 new empty file - Diff with 2 new empty files - Diff with 1 new empty file, 1 new non-empty file - Diff with 1 new empty file, 2 modified files - Diff with 1 deleted empty file - Diff with 1 deleted empty file, 1 modified file - Diff with 1 deleted empty file, 1 deleted non-empty file, 1 modified file After this change, the 3 unit tests that tested parsing a Git diff with a new
empty file failed. (Since a new empty file is now included, the number of files from parse() has increased by 1.) After updating the 3 unit tests to reflect this change, all unit tests pass.
~ The 2 new unit tests that test the deletion of empty files also pass. ~ The new unit tests also pass. - Depends On:
-
- Commit:
d789b37ec82110020d50eaab676a70ebdc4f9b2b5c12502d671da25857e41008d57ac5afad81c215- Diff:
Revision 4 (+237 -58)
- Added Files:
- Change Summary:
-
Move handling of deleted empty files for SVN to SVNDiffParser.
- Commit:
-
5c12502d671da25857e41008d57ac5afad81c215f99741861f10bcfcc3ffbc8cd72667e87a2be78a
- Change Summary:
-
Add support for Mercurial.
- Summary:
-
Add better support for added and deleted 0-length files in Git and SVN diffs.Add better support for added and deleted empty files.
- Description:
-
The addition and deletion of 0-length files were not included in the diffs of
review requests. This was especially troublesome when we needed to add or delete an empty __init__.py
file, for example.This change adds support for including new and deleted empty files in review
~ requests for Git and SVN. New empty files will be displayed with the text ~ "This is an empty file.", and deleted empty files will be displayed with the ~ text "This empty file was deleted. The content cannot be displayed." (see ~ the attached screenshots). ~ requests for Git, SVN, and Mercurial. New empty files will be displayed with ~ the text "This is an empty file.", and deleted empty files will be displayed ~ with the text "This empty file was deleted. The content cannot be displayed." ~ (see the attached screenshots). - Testing Done:
-
I used rbt post and the "New Review Request" page to create review
~ requests with different Git diffs, and rbt post for SVN diffs: ~ requests with different Git diffs, and rbt post for SVN and Mercurial diffs: - Diff with 1 new empty file - Diff with 2 new empty files - Diff with 1 new empty file, 1 new non-empty file - Diff with 1 new empty file, 2 modified files - Diff with 1 deleted empty file - Diff with 1 deleted empty file, 1 modified file - Diff with 1 deleted empty file, 1 deleted non-empty file, 1 modified file After this change, the 3 unit tests that tested parsing a Git diff with a new
empty file failed. (Since a new empty file is now included, the number of files from parse() has increased by 1.) After updating the 3 unit tests to reflect this change, all unit tests pass.
The new unit tests also pass. - Commit:
-
f99741861f10bcfcc3ffbc8cd72667e87a2be78a1a6be733ce235a593a7512d5d2e6020936dea85c
- Diff:
-
Revision 6 (+242 -58)
- Added Files:
- Change Summary:
-
Add unit tests for Mercurial diffs.
- Commit:
-
1a6be733ce235a593a7512d5d2e6020936dea85c5d936e43170ca8ddb3a9be8a989075a28345dc45
- Diff:
-
Revision 7 (+274 -58)
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: reviewboard/scmtools/hg.py reviewboard/scmtools/tests.py reviewboard/scmtools/git.py reviewboard/diffviewer/chunk_generator.py reviewboard/scmtools/svn/__init__.py Ignored Files: reviewboard/static/rb/css/diffviewer.less reviewboard/templates/diffviewer/diff_file_fragment.html
-
-
This is a review from Review Bot. Tool: Pyflakes Processed Files: reviewboard/scmtools/hg.py reviewboard/scmtools/tests.py reviewboard/scmtools/git.py reviewboard/diffviewer/chunk_generator.py reviewboard/scmtools/svn/__init__.py Ignored Files: reviewboard/static/rb/css/diffviewer.less reviewboard/templates/diffviewer/diff_file_fragment.html
-
- Change Summary:
-
Add support for Perforce.
- Description:
-
The addition and deletion of 0-length files were not included in the diffs of
review requests. This was especially troublesome when we needed to add or delete an empty __init__.py
file, for example.This change adds support for including new and deleted empty files in review
~ requests for Git, SVN, and Mercurial. New empty files will be displayed with ~ the text "This is an empty file.", and deleted empty files will be displayed ~ with the text "This empty file was deleted. The content cannot be displayed." ~ (see the attached screenshots). ~ requests for Git, SVN, Mercurial, and Perforce. New empty files will be ~ displayed with the text "This is an empty file.", and deleted empty files will ~ be displayed with the text "This empty file was deleted. The content cannot be ~ displayed." (see the attached screenshots). - Testing Done:
-
I used rbt post and the "New Review Request" page to create review
~ requests with different Git diffs, and rbt post for SVN and Mercurial diffs: ~ requests with different Git diffs, and rbt post for SVN, Mercurial, and + Perforce diffs: - Diff with 1 new empty file - Diff with 2 new empty files - Diff with 1 new empty file, 1 new non-empty file - Diff with 1 new empty file, 2 modified files - Diff with 1 deleted empty file - Diff with 1 deleted empty file, 1 modified file - Diff with 1 deleted empty file, 1 deleted non-empty file, 1 modified file After this change, the 3 unit tests that tested parsing a Git diff with a new
empty file failed. (Since a new empty file is now included, the number of files from parse() has increased by 1.) After updating the 3 unit tests to reflect this change, all unit tests pass.
The new unit tests also pass. - Added Files:
- Change Summary:
-
Add server capability to indicate support for added/deleted empty files.
- Commit:
-
5d936e43170ca8ddb3a9be8a989075a28345dc45307acd1942bb5544b730d0271c96485c569e87d6
- Diff:
-
Revision 8 (+284 -58)
-
This is a review from Review Bot. Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/webapi/server_info.py reviewboard/scmtools/hg.py reviewboard/scmtools/tests.py reviewboard/scmtools/svn/__init__.py reviewboard/scmtools/git.py Ignored Files: reviewboard/templates/diffviewer/diff_file_fragment.html reviewboard/static/rb/css/pages/diffviewer.less
-
-
This is a review from Review Bot. Tool: Pyflakes Processed Files: reviewboard/diffviewer/chunk_generator.py reviewboard/webapi/server_info.py reviewboard/scmtools/hg.py reviewboard/scmtools/tests.py reviewboard/scmtools/svn/__init__.py reviewboard/scmtools/git.py Ignored Files: reviewboard/templates/diffviewer/diff_file_fragment.html reviewboard/static/rb/css/pages/diffviewer.less
-