Diff
Modified: trunk/Tools/ChangeLog (116946 => 116947)
--- trunk/Tools/ChangeLog 2012-05-14 14:49:18 UTC (rev 116946)
+++ trunk/Tools/ChangeLog 2012-05-14 15:15:26 UTC (rev 116947)
@@ -1,3 +1,22 @@
+2012-05-14 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r116935.
+ http://trac.webkit.org/changeset/116935
+ https://bugs.webkit.org/show_bug.cgi?id=86373
+
+ Something is still broken (Requested by Ossy on #webkit).
+
+ * Scripts/webkitpy/common/checksvnconfigfile.py: Removed.
+ * Scripts/webkitpy/style/checkers/png.py:
+ (PNGChecker.check):
+ (PNGChecker):
+ (PNGChecker._config_file_path):
+ * Scripts/webkitpy/tool/commands/download.py:
+ (Land):
+ * Scripts/webkitpy/tool/steps/__init__.py:
+ * Scripts/webkitpy/tool/steps/addsvnmimetypeforpng.py: Removed.
+ * Scripts/webkitpy/tool/steps/addsvnmimetypeforpng_unittest.py: Removed.
+
2012-05-14 Allan Sandfeld Jensen <[email protected]>
[Qt] Doesn't build with ENABLE_INSPECTOR=0
Deleted: trunk/Tools/Scripts/webkitpy/common/checksvnconfigfile.py (116946 => 116947)
--- trunk/Tools/Scripts/webkitpy/common/checksvnconfigfile.py 2012-05-14 14:49:18 UTC (rev 116946)
+++ trunk/Tools/Scripts/webkitpy/common/checksvnconfigfile.py 2012-05-14 15:15:26 UTC (rev 116947)
@@ -1,83 +0,0 @@
-# Copyright (C) 2012 Balazs Ankes ([email protected]) University of Szeged
-#
-# 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
-# OWNER OR 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.
-
-# This file is used by:
-# webkitpy/tool/steps/addsvnmimetypeforpng.py
-# webkitpy/style/checkers/png.py
-
-import os
-import re
-
-
-def check(self, host, fs):
- """
- check the svn config file
- return with three logical value:
- was the file read successful, is there enable the auto-props, is there enable the svn:mime-type for png
- """
-
- config_file_path = _config_file_path(self, host, fs)
- there_is_enable_line = False
- there_is_png_line = False
-
- try:
- config_file = fs.read_text_file(config_file_path)
- except IOError:
- return (True, True, True)
-
- errorcode_autoprop = True
- errorcode_png = True
-
- for line in config_file.split('\n'):
- if not there_is_enable_line:
- match = re.search("^\s*enable-auto-props\s*=\s*yes", line)
- if match:
- there_is_enable_line = True
- errorcode_autoprop = False
- continue
-
- if not there_is_png_line:
- match = re.search("^\s*\*\.png\s*=\s*svn:mime-type=image/png", line)
- if match:
- there_is_png_line = True
- errorcode_png = False
- continue
-
- return (False, errorcode_autoprop, errorcode_png)
-
-
-def _config_file_path(self, host, fs):
- config_file = ""
- if host.platform.is_win():
- config_file_path = fs.join(os.environ['APPDATA'], "Subversion\config")
- else:
- config_file_path = fs.join(fs.expanduser("~"), ".subversion/config")
- return config_file_path
-
-
-def errorstr_autoprop(config_file_path):
- return "Have to enable auto props in the subversion config file (" + config_file_path + " \"enable-auto-props = yes\"). "
-
-
-def errorstr_png(config_file_path):
- return "Have to set the svn:mime-type in the subversion config file (" + config_file_path + " \"*.png = svn:mime-type=image/png\")."
Modified: trunk/Tools/Scripts/webkitpy/style/checkers/png.py (116946 => 116947)
--- trunk/Tools/Scripts/webkitpy/style/checkers/png.py 2012-05-14 14:49:18 UTC (rev 116946)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/png.py 2012-05-14 15:15:26 UTC (rev 116947)
@@ -27,7 +27,6 @@
import os
import re
-from webkitpy.common import checksvnconfigfile
from webkitpy.common.system.systemhost import SystemHost
from webkitpy.common.checkout.scm.detection import SCMDetector
@@ -45,24 +44,54 @@
self._detector = scm or SCMDetector(self._fs, self._host.executive).detect_scm_system(self._fs.getcwd())
def check(self, inline=None):
+ errorstr = ""
config_file_path = ""
detection = self._detector.display_name()
if detection == "git":
- (file_read, autoprop, png) = checksvnconfigfile.check(self, self._host, self._fs)
- config_file_path = checksvnconfigfile._config_file_path(self, self._host, self._fs)
+ config_file_path = self._config_file_path()
+ there_is_enable_line = False
+ there_is_png_line = False
- if file_read:
- self._handle_style_error(0, 'image/png', 5, "There is no SVN config file. (" + config_file_path + ")")
- elif autoprop and png:
- self._handle_style_error(0, 'image/png', 5, checksvnconfigfile.errorstr_autoprop(config_file_path) + checksvnconfigfile.errorstr_png(config_file_path))
- elif autoprop:
- self._handle_style_error(0, 'image/png', 5, checksvnconfigfile.errorstr_autoprop(config_file_path))
- elif png:
- self._handle_style_error(0, 'image/png', 5, checksvnconfigfile.errorstr_png(config_file_path))
+ try:
+ config_file = self._fs.read_text_file(config_file_path)
+ except IOError:
+ errorstr = "There is no " + config_file_path
+ self._handle_style_error(0, 'image/png', 5, errorstr)
+ return
+ errorstr_autoprop = "Have to enable auto props in the subversion config file (" + config_file_path + " \"enable-auto-props = yes\"). "
+ errorstr_png = "Have to set the svn:mime-type in the subversion config file (" + config_file_path + " \"*.png = svn:mime-type=image/png\")."
+
+ for line in config_file.split('\n'):
+ if not there_is_enable_line:
+ match = re.search("^\s*enable-auto-props\s*=\s*yes", line)
+ if match:
+ there_is_enable_line = True
+ errorstr_autoprop = ""
+ continue
+
+ if not there_is_png_line:
+ match = re.search("^\s*\*\.png\s*=\s*svn:mime-type=image/png", line)
+ if match:
+ there_is_png_line = True
+ errorstr_png = ""
+ continue
+
+ errorstr = errorstr_autoprop + errorstr_png
+ if errorstr:
+ self._handle_style_error(0, 'image/png', 5, errorstr)
+
elif detection == "svn":
prop_get = self._detector.propget("svn:mime-type", self._file_path)
if prop_get != "image/png":
errorstr = "Set the svn:mime-type property (svn propset svn:mime-type image/png " + self._file_path + ")."
self._handle_style_error(0, 'image/png', 5, errorstr)
+
+ def _config_file_path(self):
+ config_file = ""
+ if self._host.platform.is_win():
+ config_file_path = self._fs.join(os.environ['APPDATA'], "Subversion\config")
+ else:
+ config_file_path = self._fs.join(self._fs.expanduser("~"), ".subversion/config")
+ return config_file_path
Modified: trunk/Tools/Scripts/webkitpy/tool/commands/download.py (116946 => 116947)
--- trunk/Tools/Scripts/webkitpy/tool/commands/download.py 2012-05-14 14:49:18 UTC (rev 116946)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/download.py 2012-05-14 15:15:26 UTC (rev 116947)
@@ -90,7 +90,6 @@
argument_names = "[BUGID]"
show_in_main_help = True
steps = [
- steps.AddSvnMimetypeForPng,
steps.UpdateChangeLogsWithReviewer,
steps.ValidateReviewer,
steps.ValidateChangeLogs, # We do this after UpdateChangeLogsWithReviewer to avoid not having to cache the diff twice.
Modified: trunk/Tools/Scripts/webkitpy/tool/steps/__init__.py (116946 => 116947)
--- trunk/Tools/Scripts/webkitpy/tool/steps/__init__.py 2012-05-14 14:49:18 UTC (rev 116946)
+++ trunk/Tools/Scripts/webkitpy/tool/steps/__init__.py 2012-05-14 15:15:26 UTC (rev 116947)
@@ -27,7 +27,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# FIXME: Is this the right way to do this?
-from webkitpy.tool.steps.addsvnmimetypeforpng import AddSvnMimetypeForPng
from webkitpy.tool.steps.applypatch import ApplyPatch
from webkitpy.tool.steps.applypatchwithlocalcommit import ApplyPatchWithLocalCommit
from webkitpy.tool.steps.applywatchlist import ApplyWatchList
Deleted: trunk/Tools/Scripts/webkitpy/tool/steps/addsvnmimetypeforpng.py (116946 => 116947)
--- trunk/Tools/Scripts/webkitpy/tool/steps/addsvnmimetypeforpng.py 2012-05-14 14:49:18 UTC (rev 116946)
+++ trunk/Tools/Scripts/webkitpy/tool/steps/addsvnmimetypeforpng.py 2012-05-14 15:15:26 UTC (rev 116947)
@@ -1,77 +0,0 @@
-# Copyright (C) 2012 Balazs Ankes ([email protected]) University of Szeged
-#
-# 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
-# OWNER OR 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.
-
-from webkitpy.tool.steps.abstractstep import AbstractStep
-from webkitpy.common import checksvnconfigfile
-from webkitpy.common.system.deprecated_logging import log
-from webkitpy.common.checkout.scm.detection import SCMDetector
-from webkitpy.common.system.systemhost import SystemHost
-
-
-class AddSvnMimetypeForPng(AbstractStep):
- def __init__(self, tool, options, host=None, scm=None):
- self._tool = tool
- self._options = options
- self._host = host or SystemHost()
- self._fs = self._host.filesystem
- self._detector = scm or SCMDetector(self._fs, self._host.executive).detect_scm_system(self._fs.getcwd())
-
- def run(self, state):
- png_files = self._check_pngs(self._changed_files(state))
-
- if len(png_files) > 0:
- detection = self._detector.display_name()
-
- if detection == "git":
- (file_read, autoprop, png) = checksvnconfigfile.check(self, self._host, self._fs)
- config_file_path = checksvnconfigfile._config_file_path(self, self._host, self._fs)
-
- if file_read:
- log("There is no SVN config file. The svn:mime-type of pngs won't set.")
- if not self._tool.user.confirm("Are you sure you want to continue?", default="n"):
- self._exit(1)
- elif autoprop and png:
- log(checksvnconfigfile.errorstr_autoprop(config_file_path) + checksvnconfigfile.errorstr_png(config_file_path))
- if not self._tool.user.confirm("Do you want to continue?", default="n"):
- self._exit(1)
- elif autoprop:
- log(checksvnconfigfile.errorstr_autoprop(config_file_path))
- if not self._tool.user.confirm("Do you want to continue?", default="n"):
- self._exit(1)
- elif png:
- log(checksvnconfigfile.errorstr_png(config_file_path))
- if not self._tool.user.confirm("Do you want to continue?", default="n"):
- self._exit(1)
-
- elif detection == "svn":
- for filename in png_files:
- if filename.endswith('.png') and detector.exists(filename) and detector.propget('svn:mime-type', filename) == "":
- print "Adding image/png mime-type to %s" % filename
- detector.propset('svn:mime-type', 'image/png', filename)
-
- def _check_pngs(self, changed_files):
- png_files = []
- for filename in changed_files:
- if filename.endswith('.png'):
- png_files.append(filename)
- return png_files
Deleted: trunk/Tools/Scripts/webkitpy/tool/steps/addsvnmimetypeforpng_unittest.py (116946 => 116947)
--- trunk/Tools/Scripts/webkitpy/tool/steps/addsvnmimetypeforpng_unittest.py 2012-05-14 14:49:18 UTC (rev 116946)
+++ trunk/Tools/Scripts/webkitpy/tool/steps/addsvnmimetypeforpng_unittest.py 2012-05-14 15:15:26 UTC (rev 116947)
@@ -1,60 +0,0 @@
-# Copyright (C) 2012 Balazs Ankes ([email protected]) University of Szeged
-#
-# 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
-# OWNER OR 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.
-
-import unittest
-
-from webkitpy.tool.steps.addsvnmimetypeforpng import AddSvnMimetypeForPng
-from webkitpy.common.system.filesystem_mock import MockFileSystem
-from webkitpy.tool.mocktool import MockOptions, MockTool
-from webkitpy.common.system.systemhost_mock import MockSystemHost
-from webkitpy.common.system.outputcapture import OutputCapture
-
-
-class MockSCMDetector(object):
-
- def __init__(self, scm):
- self._scm = scm
-
- def display_name(self):
- return self._scm
-
-
-class AddSvnMimetypeForPngTest(unittest.TestCase):
- def test_run(self):
- capture = OutputCapture()
- options = MockOptions()
- options.git_commit = 'MOCK git commit'
-
- files = {'/Users/mock/.subversion/config': 'enable-auto-props = yes\n*.png = svn:mime-type=image/png'}
- fs = MockFileSystem(files)
- scm = MockSCMDetector('git')
-
- step = AddSvnMimetypeForPng(MockTool(), options, MockSystemHost(os_name='linux', filesystem=fs), scm)
- state = {
- "changed_files": ["test.png"],
- }
- try:
- capture.assert_outputs(self, step.run, [state])
- except SystemExit, e:
- self.assertEquals(type(e), type(SystemExit()))
- self.assertEquals(e.code, 1)