Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/style/patchreader.py

Issue 2742453003: webkitpy: Simplify DiffParser, removing support for SVN patches. (Closed)
Patch Set: Re-add accidentally-removed baseline Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Tools/Scripts/webkitpy/style/patchreader.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/style/patchreader.py b/third_party/WebKit/Tools/Scripts/webkitpy/style/patchreader.py
index 54b13a65a32aad584ec292c79dddc161b93bb481..a6a0795004ba71ab940251493810db8983b799ad 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/style/patchreader.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/style/patchreader.py
@@ -29,10 +29,8 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import logging
-import re
from webkitpy.common.checkout.diff_parser import DiffParser
-from webkitpy.common.system.filesystem import FileSystem
_log = logging.getLogger(__name__)
@@ -49,26 +47,15 @@ class PatchReader(object):
"""
self._text_file_reader = text_file_reader
- def check(self, patch_string, fs=None):
- """Check style in the given patch."""
- fs = fs or FileSystem()
+ def check(self, patch_string):
+ """Checks style in the given patch."""
patch_files = DiffParser(patch_string.splitlines()).files
- # If the user uses git, checking subversion config file only once is enough.
- # TODO(qyearsley): Simplify this since git is now the only supported SCM system.
- call_only_once = True
-
for path, diff_file in patch_files.iteritems():
line_numbers = diff_file.added_or_modified_line_numbers()
_log.debug('Found %s new or modified lines in: %s', len(line_numbers), path)
if not line_numbers:
- match = re.search(r"\s*png$", path)
- if match and fs.exists(path):
- if call_only_once:
- self._text_file_reader.process_file(file_path=path, line_numbers=None)
- call_only_once = False
- continue
# Don't check files which contain only deleted lines
# as they can never add style errors. However, mark them as
# processed so that we count up number of such files.

Powered by Google App Engine
This is Rietveld 408576698