Diff
Modified: trunk/Tools/ChangeLog (90548 => 90549)
--- trunk/Tools/ChangeLog 2011-07-07 07:44:42 UTC (rev 90548)
+++ trunk/Tools/ChangeLog 2011-07-07 08:03:58 UTC (rev 90549)
@@ -1,3 +1,22 @@
+2011-07-07 Adam Barth <[email protected]>
+
+ Remove style_references.py
+ https://bugs.webkit.org/show_bug.cgi?id=64070
+
+ Reviewed by Eric Seidel.
+
+ We never really adopted the _references design, and this file is a bit
+ of an orphan at this point.
+
+ * Scripts/check-webkit-style:
+ * Scripts/webkitpy/style/checker.py:
+ * Scripts/webkitpy/style/checker_unittest.py:
+ * Scripts/webkitpy/style/checkers/python.py:
+ * Scripts/webkitpy/style/checkers/test_expectations.py:
+ * Scripts/webkitpy/style/checkers/test_expectations_unittest.py:
+ * Scripts/webkitpy/style/main_unittest.py:
+ * Scripts/webkitpy/style_references.py: Removed.
+
2011-07-07 Eric Seidel <[email protected]>
Fix WebKit2 expected results search paths for Mac and Qt under new-run-webkit-tests
Modified: trunk/Tools/Scripts/check-webkit-style (90548 => 90549)
--- trunk/Tools/Scripts/check-webkit-style 2011-07-07 07:44:42 UTC (rev 90548)
+++ trunk/Tools/Scripts/check-webkit-style 2011-07-07 08:03:58 UTC (rev 90549)
@@ -48,7 +48,7 @@
import os.path
import sys
-from webkitpy.style_references import detect_checkout
+from webkitpy.common.checkout.scm import detect_scm_system
import webkitpy.style.checker as checker
from webkitpy.style.patchreader import PatchReader
from webkitpy.style.checker import StyleProcessor
@@ -89,9 +89,10 @@
parser = checker.check_webkit_style_parser()
(paths, options) = parser.parse(args)
- checkout = detect_checkout()
+ cwd = os.path.abspath(os.curdir)
+ scm = detect_scm_system(cwd)
- if checkout is None:
+ if scm is None:
if not paths:
_log.error("WebKit checkout not found: You must run this script "
"from within a WebKit checkout if you are not passing "
@@ -101,7 +102,7 @@
checkout_root = None
_log.debug("WebKit checkout not found for current directory.")
else:
- checkout_root = checkout.root_path()
+ checkout_root = scm.checkout_root
_log.debug("WebKit checkout found with root: %s" % checkout_root)
configuration = checker.check_webkit_style_configuration(options)
@@ -116,7 +117,7 @@
file_reader.process_paths(paths)
else:
changed_files = paths if options.diff_files else None
- patch = checkout.create_patch(options.git_commit, changed_files=changed_files)
+ patch = scm.create_patch(options.git_commit, changed_files=changed_files)
patch_checker = PatchReader(file_reader)
patch_checker.check(patch)
Modified: trunk/Tools/Scripts/webkitpy/style/checker.py (90548 => 90549)
--- trunk/Tools/Scripts/webkitpy/style/checker.py 2011-07-07 07:44:42 UTC (rev 90548)
+++ trunk/Tools/Scripts/webkitpy/style/checker.py 2011-07-07 08:03:58 UTC (rev 90549)
@@ -47,7 +47,7 @@
from filter import FilterConfiguration
from optparser import ArgumentParser
from optparser import DefaultCommandOptionValues
-from webkitpy.style_references import configure_logging as _configure_logging
+from webkitpy.common.system.logutils import configure_logging as _configure_logging
_log = logging.getLogger(__name__)
Modified: trunk/Tools/Scripts/webkitpy/style/checker_unittest.py (90548 => 90549)
--- trunk/Tools/Scripts/webkitpy/style/checker_unittest.py 2011-07-07 07:44:42 UTC (rev 90548)
+++ trunk/Tools/Scripts/webkitpy/style/checker_unittest.py 2011-07-07 08:03:58 UTC (rev 90549)
@@ -39,8 +39,7 @@
import unittest
import checker as style
-from webkitpy.style_references import LogTesting
-from webkitpy.style_references import TestLogStream
+from webkitpy.common.system.logtesting import LogTesting, TestLogStream
from checker import _BASE_FILTER_RULES
from checker import _MAX_REPORTS_PER_CATEGORY
from checker import _PATH_RULES_SPECIFIER as PATH_RULES_SPECIFIER
Modified: trunk/Tools/Scripts/webkitpy/style/checkers/python.py (90548 => 90549)
--- trunk/Tools/Scripts/webkitpy/style/checkers/python.py 2011-07-07 07:44:42 UTC (rev 90548)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/python.py 2011-07-07 08:03:58 UTC (rev 90549)
@@ -22,7 +22,7 @@
"""Supports checking WebKit style in Python files."""
-from ...style_references import pep8
+from webkitpy.thirdparty.autoinstalled import pep8
class PythonChecker(object):
Modified: trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations.py (90548 => 90549)
--- trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations.py 2011-07-07 07:44:42 UTC (rev 90548)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations.py 2011-07-07 08:03:58 UTC (rev 90549)
@@ -34,8 +34,8 @@
import sys
from common import TabChecker
-from webkitpy.style_references import port
-from webkitpy.style_references import test_expectations
+from webkitpy.layout_tests import port
+from webkitpy.layout_tests.models import test_expectations
_log = logging.getLogger(__name__)
Modified: trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py (90548 => 90549)
--- trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py 2011-07-07 07:44:42 UTC (rev 90548)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py 2011-07-07 08:03:58 UTC (rev 90549)
@@ -31,16 +31,8 @@
import sys
import unittest
-# We need following workaround hack to run this unit tests in stand-alone.
-try:
- d = os.path.dirname(__file__)
-except NameError:
- d = os.path.dirname(sys.argv[0])
-sys.path.append(os.path.abspath(os.path.join(d, '../../../')))
-
from test_expectations import TestExpectationsChecker
-from webkitpy.style_references import port
-from webkitpy.style_references import test_expectations as test_expectations_style
+from webkitpy.layout_tests import port
class ErrorCollector(object):
@@ -163,6 +155,3 @@
self.assert_lines_lint(
["\tBUGWK1 : passes/text.html = PASS"],
"Line contains tab character. [whitespace/tab] [5]")
-
-if __name__ == '__main__':
- unittest.main()
Modified: trunk/Tools/Scripts/webkitpy/style/main_unittest.py (90548 => 90549)
--- trunk/Tools/Scripts/webkitpy/style/main_unittest.py 2011-07-07 07:44:42 UTC (rev 90548)
+++ trunk/Tools/Scripts/webkitpy/style/main_unittest.py 2011-07-07 08:03:58 UTC (rev 90549)
@@ -26,7 +26,7 @@
import unittest
from main import change_directory
-from webkitpy.style_references import LogTesting
+from webkitpy.common.system.logtesting import LogTesting
class ChangeDirectoryTest(unittest.TestCase):
Deleted: trunk/Tools/Scripts/webkitpy/style_references.py (90548 => 90549)
--- trunk/Tools/Scripts/webkitpy/style_references.py 2011-07-07 07:44:42 UTC (rev 90548)
+++ trunk/Tools/Scripts/webkitpy/style_references.py 2011-07-07 08:03:58 UTC (rev 90549)
@@ -1,73 +0,0 @@
-# Copyright (C) 2010 Chris Jerdonek ([email protected])
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""References to non-style modules used by the style package."""
-
-# This module is a simple facade to the functionality used by the
-# style package that comes from WebKit modules outside the style
-# package.
-#
-# With this module, the only intra-package references (i.e.
-# references to webkitpy modules outside the style folder) that
-# the style package needs to make are relative references to
-# this module. For example--
-#
-# > from .. style_references import parse_patch
-#
-# Similarly, people maintaining non-style code are not beholden
-# to the contents of the style package when refactoring or
-# otherwise changing non-style code. They only have to be aware
-# of this module.
-
-import os
-
-from webkitpy.common.checkout.diff_parser import DiffParser
-from webkitpy.common.system.logtesting import LogTesting
-from webkitpy.common.system.logtesting import TestLogStream
-from webkitpy.common.system.logutils import configure_logging
-from webkitpy.common.checkout.scm import detect_scm_system
-from webkitpy.layout_tests import port
-from webkitpy.layout_tests.models import test_expectations
-from webkitpy.thirdparty.autoinstalled import pep8
-
-
-def detect_checkout():
- """Return a WebKitCheckout instance, or None if it cannot be found."""
- cwd = os.path.abspath(os.curdir)
- scm = detect_scm_system(cwd)
-
- return None if scm is None else WebKitCheckout(scm)
-
-
-class WebKitCheckout(object):
-
- """Simple facade to the SCM class for use by style package."""
-
- def __init__(self, scm):
- self._scm = scm
-
- def root_path(self):
- """Return the checkout root as an absolute path."""
- return self._scm.checkout_root
-
- def create_patch(self, git_commit, changed_files=None):
- return self._scm.create_patch(git_commit, changed_files=changed_files)