diff options
author | Steve Block <steveblock@google.com> | 2010-07-08 12:51:48 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-07-09 15:33:40 +0100 |
commit | ca9cb53ed1119a3fd98fafa0972ffeb56dee1c24 (patch) | |
tree | bb45155550ec013adc0ad10f4d7d354c6469b022 /WebKitTools/Scripts | |
parent | d4b24d9a829ed7de70381c8b99fb75a07ab40466 (diff) | |
download | external_webkit-ca9cb53ed1119a3fd98fafa0972ffeb56dee1c24.zip external_webkit-ca9cb53ed1119a3fd98fafa0972ffeb56dee1c24.tar.gz external_webkit-ca9cb53ed1119a3fd98fafa0972ffeb56dee1c24.tar.bz2 |
Merge WebKit at r62496: Initial merge by git
Change-Id: Ie3da0770eca22a70a632e3571f31cfabc80facb2
Diffstat (limited to 'WebKitTools/Scripts')
-rwxr-xr-x | WebKitTools/Scripts/build-webkit | 10 | ||||
-rwxr-xr-x | WebKitTools/Scripts/build-webkittestrunner | 68 | ||||
-rwxr-xr-x | WebKitTools/Scripts/debug-test-runner | 35 | ||||
-rwxr-xr-x | WebKitTools/Scripts/num-cpus | 9 | ||||
-rwxr-xr-x | WebKitTools/Scripts/old-run-webkit-tests | 15 | ||||
-rwxr-xr-x | WebKitTools/Scripts/run-test-runner | 35 | ||||
-rwxr-xr-x | WebKitTools/Scripts/test-html5-parser | 3 | ||||
-rw-r--r-- | WebKitTools/Scripts/webkitdirs.pm | 85 | ||||
-rw-r--r-- | WebKitTools/Scripts/webkitpy/common/checkout/scm.py | 161 | ||||
-rw-r--r-- | WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py | 108 | ||||
-rw-r--r-- | WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py | 173 | ||||
-rw-r--r-- | WebKitTools/Scripts/webkitpy/style/checker.py | 2 | ||||
-rwxr-xr-x | WebKitTools/Scripts/webkitpy/style/checker_unittest.py | 4 | ||||
-rw-r--r-- | WebKitTools/Scripts/webkitpy/tool/commands/download.py | 2 | ||||
-rw-r--r-- | WebKitTools/Scripts/webkitpy/tool/commands/upload.py | 7 | ||||
-rw-r--r-- | WebKitTools/Scripts/webkitpy/tool/steps/ensurebuildersaregreen.py | 6 |
16 files changed, 522 insertions, 201 deletions
diff --git a/WebKitTools/Scripts/build-webkit b/WebKitTools/Scripts/build-webkit index 88765e8..2934b21 100755 --- a/WebKitTools/Scripts/build-webkit +++ b/WebKitTools/Scripts/build-webkit @@ -59,9 +59,9 @@ my ($threeDCanvasSupport, $threeDRenderingSupport, $channelMessagingSupport, $cl $domStorageSupport, $eventsourceSupport, $filtersSupport, $geolocationSupport, $iconDatabaseSupport, $imageResizerSupport, $indexedDatabaseSupport, $inputSpeechSupport, $javaScriptDebuggerSupport, $mathmlSupport, $offlineWebApplicationSupport, $rubySupport, $systemMallocSupport, $sandboxSupport, $sharedWorkersSupport, $svgSupport, $svgAnimationSupport, $svgAsImageSupport, $svgDOMObjCBindingsSupport, $svgFontsSupport, - $svgForeignObjectSupport, $svgUseSupport, $videoSupport, $webSocketsSupport, $wmlSupport, $wcssSupport, $xhtmlmpSupport, $workersSupport, + $svgForeignObjectSupport, $svgUseSupport, $videoSupport, $webSocketsSupport, $webTimingSupport, $wmlSupport, $wcssSupport, $xhtmlmpSupport, $workersSupport, $xpathSupport, $xsltSupport, $coverageSupport, $notificationsSupport, $blobSliceSupport, $tiledBackingStoreSupport, - $fileReaderSupport, $fileWriterSupport); + $fileReaderSupport, $fileWriterSupport, $directoryUploadSupport); my @features = ( { option => "3d-canvas", desc => "Toggle 3D canvas support", @@ -91,6 +91,9 @@ my @features = ( { option => "datalist", desc => "Toggle HTML5 datalist support", define => "ENABLE_DATALIST", default => 1, value => \$datalistSupport }, + { option => "directory-upload", desc => "Toogle Directory upload support", + define => "ENABLE_DIRECTORY_UPLOAD", default => 0, value => \$directoryUploadSupport }, + { option => "dom-storage", desc => "Toggle DOM Storage Support", define => "ENABLE_DOM_STORAGE", default => 1, value => \$domStorageSupport }, @@ -169,6 +172,9 @@ my @features = ( { option => "web-sockets", desc => "Toggle Web Sockets support", define => "ENABLE_WEB_SOCKETS", default => 1, value=> \$webSocketsSupport }, + { option => "web-timing", desc => "Toggle Web Timing support", + define => "ENABLE_WEB_TIMING", default => 0, value=> \$webTimingSupport }, + { option => "wml", desc => "Toggle WML support", define => "ENABLE_WML", default => 0, value => \$wmlSupport }, diff --git a/WebKitTools/Scripts/build-webkittestrunner b/WebKitTools/Scripts/build-webkittestrunner new file mode 100755 index 0000000..bb059e1 --- /dev/null +++ b/WebKitTools/Scripts/build-webkittestrunner @@ -0,0 +1,68 @@ +#!/usr/bin/perl -w + +# Copyright (C) 2010 Apple Inc. All rights reserved. +# +# 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. + +use strict; +use File::Basename; +use FindBin; +use Getopt::Long qw(:config pass_through); +use lib $FindBin::Bin; +use webkitdirs; +use POSIX; + +my $showHelp = 0; +my $clean = 0; + +my $programName = basename($0); +my $usage = <<EOF; +Usage: $programName [options] [options to pass to build system] + --help Show this help message + --clean Clean up the build directory +EOF + +GetOptions( + 'help' => \$showHelp, + 'clean' => \$clean, +); + +if ($showHelp) { + print STDERR $usage; + exit 1; +} + +checkRequiredSystemConfig(); +setConfiguration(); +chdirWebKit(); + +# Build +chdir "WebKitTools/WebKitTestRunner" or die; + +my $result; +if (isAppleMacWebKit()) { + $result = buildXCodeProject("WebKitTestRunner", $clean, XcodeOptions(), @ARGV); +} else { + die "WebKitTestRunner is not supported on this platform.\n"; +} + +exit exitStatus($result); diff --git a/WebKitTools/Scripts/debug-test-runner b/WebKitTools/Scripts/debug-test-runner new file mode 100755 index 0000000..5a9b7f9 --- /dev/null +++ b/WebKitTools/Scripts/debug-test-runner @@ -0,0 +1,35 @@ +#!/usr/bin/perl -w + +# Copyright (C) 2010 Apple Inc. All rights reserved. +# +# 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. + +# Simplified "debug" script for debugging the WebKitTestRunner. + +use strict; +use FindBin; +use lib $FindBin::Bin; +use webkitdirs; + +setConfiguration(); + +exit exitStatus(debugWebKitTestRunner()); diff --git a/WebKitTools/Scripts/num-cpus b/WebKitTools/Scripts/num-cpus index ede9995..8a8c97f 100755 --- a/WebKitTools/Scripts/num-cpus +++ b/WebKitTools/Scripts/num-cpus @@ -1,3 +1,6 @@ -#!/bin/bash -# Assumes cygwin. -ls /proc/registry/HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System/CentralProcessor | wc -w +#!/usr/bin/perl -w +use strict; +use FindBin; +use lib $FindBin::Bin; +use webkitdirs; +print numberOfCPUs() . "\n"; diff --git a/WebKitTools/Scripts/old-run-webkit-tests b/WebKitTools/Scripts/old-run-webkit-tests index a25a24d..0e705a9 100755 --- a/WebKitTools/Scripts/old-run-webkit-tests +++ b/WebKitTools/Scripts/old-run-webkit-tests @@ -1,6 +1,6 @@ #!/usr/bin/perl -# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. # Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) # Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com) # Copyright (C) 2007 Eric Seidel <eric@webkit.org> @@ -165,6 +165,7 @@ my $useRemoteLinksToTests = 0; my $useValgrind = 0; my $verbose = 0; my $shouldWaitForHTTPD = 0; +my $useWebKitTestRunner = 0; my @leaksFilenames; @@ -279,6 +280,7 @@ Usage: $programName [options] [testdir|testpath ...] -v|--verbose More verbose output (overrides --quiet) -m|--merge-leak-depth arg Merges leak callStacks and prints the number of unique leaks beneath a callstack depth of arg. Defaults to 5. --use-remote-links-to-tests Link to test files within the SVN repository in the results. + --webkit-test-runner Use WebKitTestRunner rather than DumpRenderTree. EOF setConfiguration(); @@ -321,6 +323,7 @@ my $getOptionsResult = GetOptions( 'use-remote-links-to-tests' => \$useRemoteLinksToTests, 'valgrind' => \$useValgrind, 'verbose|v' => \$verbose, + 'webkit-test-runner' => \$useWebKitTestRunner, ); if (!$getOptionsResult || $showHelp) { @@ -354,8 +357,11 @@ $productDir .= "/Programs" if isGtk(); chdirWebKit(); +my $dumpToolName = $useWebKitTestRunner ? "WebKitTestRunner" : "DumpRenderTree"; + if (!defined($root)) { - print STDERR "Running build-dumprendertree\n"; + my $dumpToolBuildScript = "build-" . lc($dumpToolName); + print STDERR "Running $dumpToolBuildScript\n"; local *DEVNULL; my ($childIn, $childOut, $childErr); @@ -370,7 +376,7 @@ if (!defined($root)) { } my @args = argumentsForConfiguration(); - my $buildProcess = open3($childIn, $childOut, $childErr, "WebKitTools/Scripts/build-dumprendertree", @args) or die "Failed to run build-dumprendertree"; + my $buildProcess = open3($childIn, $childOut, $childErr, "WebKitTools/Scripts/$dumpToolBuildScript", @args) or die "Failed to run build-dumprendertree"; close($childIn); waitpid $buildProcess, 0; my $buildResult = $?; @@ -380,12 +386,11 @@ if (!defined($root)) { close DEVNULL if ($quiet); if ($buildResult) { - print STDERR "Compiling DumpRenderTree failed!\n"; + print STDERR "Compiling $dumpToolName failed!\n"; exit exitStatus($buildResult); } } -my $dumpToolName = "DumpRenderTree"; $dumpToolName .= "_debug" if isCygwin() && configurationForVisualStudio() !~ /^Release|Debug_Internal$/; my $dumpTool = "$productDir/$dumpToolName"; die "can't find executable $dumpToolName (looked in $productDir)\n" unless -x $dumpTool; diff --git a/WebKitTools/Scripts/run-test-runner b/WebKitTools/Scripts/run-test-runner new file mode 100755 index 0000000..98fa3b6 --- /dev/null +++ b/WebKitTools/Scripts/run-test-runner @@ -0,0 +1,35 @@ +#!/usr/bin/perl -w + +# Copyright (C) 2010 Apple Inc. All rights reserved. +# +# 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. + +# Simplified "run" script for launching the WebKit2 WebKitTestRunner. + +use strict; +use FindBin; +use lib $FindBin::Bin; +use webkitdirs; + +setConfiguration(); + +exit exitStatus(runWebKitTestRunner()); diff --git a/WebKitTools/Scripts/test-html5-parser b/WebKitTools/Scripts/test-html5-parser index 5b935b8..eb9bab4 100755 --- a/WebKitTools/Scripts/test-html5-parser +++ b/WebKitTools/Scripts/test-html5-parser @@ -60,7 +60,6 @@ system("WebKitTools/Scripts/build-dumprendertree", @args) == 0 or die "Failed to my @tests = ( "html5lib/runner", - "html5lib/webkit-resumer", ); foreach my $test (@tests) { @@ -69,7 +68,7 @@ foreach my $test (@tests) { my $testPath = "LayoutTests/$test.html"; my $expectedPath = "LayoutTests/$test-expected-html5.txt"; my $actualPath = "LayoutTests/$test-actual-html5.txt"; - my $command = "DYLD_FRAMEWORK_PATH=$productDir $dumpTool --html5-parser $testPath"; + my $command = "DYLD_FRAMEWORK_PATH=$productDir $dumpTool --html5-treebuilder $testPath"; print $command, "\n"; my $output = `$command`; writeToFile($actualPath, $output); diff --git a/WebKitTools/Scripts/webkitdirs.pm b/WebKitTools/Scripts/webkitdirs.pm index 46d2cbf..9f54c3e 100644 --- a/WebKitTools/Scripts/webkitdirs.pm +++ b/WebKitTools/Scripts/webkitdirs.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved. +# Copyright (C) 2005, 2006, 2007, 2010 Apple Inc. All rights reserved. # Copyright (C) 2009 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -50,6 +50,7 @@ BEGIN { our @EXPORT_OK; my $architecture; +my $numberOfCPUs; my $baseProductDir; my @baseProductDirOption; my $configuration; @@ -229,6 +230,28 @@ sub determineArchitecture } } +sub determineNumberOfCPUs +{ + return if defined $numberOfCPUs; + if (isLinux()) { + # First try the nproc utility, if it exists. If we get no + # results fall back to just interpretting /proc directly. + $numberOfCPUs = `nproc 2> /dev/null`; + if ($numberOfCPUs eq "") { + $numberOfCPUs = (grep /processor/, `cat /proc/cpuinfo`); + } + } elsif (isWindows() || isCygwin()) { + if (defined($ENV{NUMBER_OF_PROCESSORS})) { + $numberOfCPUs = $ENV{NUMBER_OF_PROCESSORS}; + } else { + # Assumes cygwin + $numberOfCPUs = `ls /proc/registry/HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System/CentralProcessor | wc -w`; + } + } elsif (isDarwin()) { + $numberOfCPUs = `sysctl -n hw.ncpu`; + } +} + sub jscPath($) { my ($productDir) = @_; @@ -468,6 +491,12 @@ sub architecture() return $architecture; } +sub numberOfCPUs() +{ + determineNumberOfCPUs(); + return $numberOfCPUs; +} + sub setArchitecture { if (my $arch = shift @_) { @@ -566,7 +595,7 @@ sub builtDylibPathForName return "$configurationProductDir/libwxwebkit.dylib"; } if (isGtk()) { - return "$configurationProductDir/$libraryName/../.libs/libwebkit-1.0.so"; + return "$configurationProductDir/$libraryName/../.libs/libwebkitgtk-1.0.so"; } if (isEfl()) { return "$configurationProductDir/$libraryName/../.libs/libewebkit.so"; @@ -687,8 +716,6 @@ sub determineIsSymbian() $isSymbian = 1; return; } - - $isSymbian = defined($ENV{'EPOCROOT'}); } sub determineIsEfl() @@ -1260,6 +1287,12 @@ sub buildAutotoolsProject($@) } } + # Automatically determine the number of CPUs for make only + # if make arguments haven't already been specified. + if ($makeArgs eq "") { + $makeArgs = "-j" . numberOfCPUs(); + } + $prefix = $ENV{"WebKitInstallationPrefix"} if !defined($prefix); push @buildArgs, "--prefix=" . $prefix if defined($prefix); @@ -1443,7 +1476,7 @@ sub buildChromiumMakefile($$) return system qw(rm -rf out); } my $config = configuration(); - my $numCpus = (grep /processor/, `cat /proc/cpuinfo`) || 1; + my $numCpus = numberOfCPUs(); my @command = ("make", "-fMakefile.chromium", "-j$numCpus", "BUILDTYPE=$config", $target); print join(" ", @command) . "\n"; return system @command; @@ -1493,6 +1526,9 @@ sub buildChromium($@) { my ($clean, @options) = @_; + # We might need to update DEPS or re-run GYP if things have changed. + system("perl", "WebKitTools/Scripts/update-webkit-chromium") == 0 or die $!; + my $result = 1; if (isDarwin()) { # Mac build - builds the root xcode project. @@ -1610,4 +1646,43 @@ sub debugMiniBrowser return 1; } +sub runWebKitTestRunner +{ + if (isAppleMacWebKit()) { + my $productDir = productDir(); + print "Starting WebKitTestRunner with DYLD_FRAMEWORK_PATH set to point to $productDir.\n"; + $ENV{DYLD_FRAMEWORK_PATH} = $productDir; + $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES"; + my $webKitTestRunnerPath = "$productDir/WebKitTestRunner"; + if (!isTiger() && architecture()) { + return system "arch", "-" . architecture(), $webKitTestRunnerPath, @ARGV; + } else { + return system $webKitTestRunnerPath, @ARGV; + } + } + + return 1; +} + +sub debugWebKitTestRunner +{ + if (isAppleMacWebKit()) { + my $gdbPath = "/usr/bin/gdb"; + die "Can't find gdb executable. Is gdb installed?\n" unless -x $gdbPath; + + my $productDir = productDir(); + $ENV{DYLD_FRAMEWORK_PATH} = $productDir; + $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = 'YES'; + + my $webKitTestRunnerPath = "$productDir/WebKitTestRunner"; + + print "Starting WebKitTestRunner under gdb with DYLD_FRAMEWORK_PATH set to point to $productDir.\n"; + my @architectureFlags = ("-arch", architecture()) if !isTiger(); + exec $gdbPath, @architectureFlags, $webKitTestRunnerPath or die; + return; + } + + return 1; +} + 1; diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/scm.py b/WebKitTools/Scripts/webkitpy/common/checkout/scm.py index fc4c6fd..d7c621c 100644 --- a/WebKitTools/Scripts/webkitpy/common/checkout/scm.py +++ b/WebKitTools/Scripts/webkitpy/common/checkout/scm.py @@ -31,6 +31,8 @@ import os import re +import sys +import shutil from webkitpy.common.system.executive import Executive, run_command, ScriptError from webkitpy.common.system.user import User @@ -166,82 +168,95 @@ class SCM: return match.group('svn_revision') @staticmethod + def _subclass_must_implement(): + raise NotImplementedError("subclasses must implement") + + @staticmethod def in_working_directory(path): - raise NotImplementedError, "subclasses must implement" + SCM._subclass_must_implement() @staticmethod def find_checkout_root(path): - raise NotImplementedError, "subclasses must implement" + SCM._subclass_must_implement() @staticmethod def commit_success_regexp(): - raise NotImplementedError, "subclasses must implement" + SCM._subclass_must_implement() def working_directory_is_clean(self): - raise NotImplementedError, "subclasses must implement" + self._subclass_must_implement() def clean_working_directory(self): - raise NotImplementedError, "subclasses must implement" + self._subclass_must_implement() def status_command(self): - raise NotImplementedError, "subclasses must implement" + self._subclass_must_implement() - def add(self, path): - raise NotImplementedError, "subclasses must implement" + def add(self, path, return_exit_code=False): + self._subclass_must_implement() + + def delete(self, path): + self._subclass_must_implement() def changed_files(self, git_commit=None, squash=None): - raise NotImplementedError, "subclasses must implement" + self._subclass_must_implement() def changed_files_for_revision(self): - raise NotImplementedError, "subclasses must implement" + self._subclass_must_implement() def added_files(self): - raise NotImplementedError, "subclasses must implement" + self._subclass_must_implement() def conflicted_files(self): - raise NotImplementedError, "subclasses must implement" + self._subclass_must_implement() def display_name(self): - raise NotImplementedError, "subclasses must implement" + self._subclass_must_implement() def create_patch(self, git_commit=None, squash=None): - raise NotImplementedError, "subclasses must implement" + self._subclass_must_implement() def committer_email_for_revision(self, revision): - raise NotImplementedError, "subclasses must implement" + self._subclass_must_implement() def contents_at_revision(self, path, revision): - raise NotImplementedError, "subclasses must implement" + self._subclass_must_implement() def diff_for_revision(self, revision): - raise NotImplementedError, "subclasses must implement" + self._subclass_must_implement() + + def diff_for_file(self, path, log=None): + self._subclass_must_implement() + + def show_head(self, path): + self._subclass_must_implement() def apply_reverse_diff(self, revision): - raise NotImplementedError, "subclasses must implement" + self._subclass_must_implement() def revert_files(self, file_paths): - raise NotImplementedError, "subclasses must implement" + self._subclass_must_implement() def should_squash(self, squash): - raise NotImplementedError, "subclasses must implement" + self._subclass_must_implement() def commit_with_message(self, message, username=None, git_commit=None, squash=None): - raise NotImplementedError, "subclasses must implement" + self._subclass_must_implement() def svn_commit_log(self, svn_revision): - raise NotImplementedError, "subclasses must implement" + self._subclass_must_implement() def last_svn_commit_log(self): - raise NotImplementedError, "subclasses must implement" + self._subclass_must_implement() # Subclasses must indicate if they support local commits, # but the SCM baseclass will only call local_commits methods when this is true. @staticmethod def supports_local_commits(): - raise NotImplementedError, "subclasses must implement" + SCM._subclass_must_implement() def remote_merge_base(): - raise NotImplementedError, "subclasses must implement" + SCM._subclass_must_implement() def commit_locally_with_message(self, message): error("Your source control manager does not support local commits.") @@ -261,7 +276,8 @@ class SVN(SCM): def __init__(self, cwd): SCM.__init__(self, cwd) self.cached_version = None - + self._bogus_dir = None + @staticmethod def in_working_directory(path): return os.path.isdir(os.path.join(path, '.svn')) @@ -343,9 +359,23 @@ class SVN(SCM): field_count = 6 if self.svn_version() > "1.6" else 5 return "^(?P<status>[%s]).{%s} (?P<filename>.+)$" % (expected_types, field_count) - def add(self, path): - # path is assumed to be cwd relative? - self.run(["svn", "add", path]) + def _add_parent_directories(self, path): + """Does 'svn add' to the path and its parents.""" + if self.in_working_directory(path): + return + dirname = os.path.dirname(path) + # We have dirname directry - ensure it added. + if dirname != path: + self._add_parent_directories(dirname) + self.add(path) + + def add(self, path, return_exit_code=False): + self._add_parent_directories(os.path.dirname(os.path.abspath(path))) + return self.run(["svn", "add", path], return_exit_code=return_exit_code) + + def delete(self, path): + parent, base = os.path.split(os.path.abspath(path)) + return self.run(["svn", "delete", "--force", base], cwd=parent) def changed_files(self, git_commit=None, squash=None): return self.run_status_and_extract_filenames(self.status_command(), self._status_regexp("ACDMR")) @@ -362,6 +392,9 @@ class SVN(SCM): def added_files(self): return self.run_status_and_extract_filenames(self.status_command(), self._status_regexp("A")) + def deleted_files(self): + return self.run_status_and_extract_filenames(self.status_command(), self._status_regexp("D")) + @staticmethod def supports_local_commits(): return False @@ -391,6 +424,44 @@ class SVN(SCM): # FIXME: This should probably use cwd=self.checkout_root return self.run(['svn', 'diff', '-c', revision]) + def _bogus_dir_name(self): + if sys.platform.startswith("win"): + parent_dir = tempfile.gettempdir() + else: + parent_dir = sys.path[0] # tempdir is not secure. + return os.path.join(parent_dir, "temp_svn_config") + + def _setup_bogus_dir(self, log): + self._bogus_dir = self._bogus_dir_name() + if not os.path.exists(self._bogus_dir): + os.mkdir(self._bogus_dir) + self._delete_bogus_dir = True + else: + self._delete_bogus_dir = False + if log: + log.debug(' Html: temp config dir: "%s".', self._bogus_dir) + + def _teardown_bogus_dir(self, log): + if self._delete_bogus_dir: + shutil.rmtree(self._bogus_dir, True) + if log: + log.debug(' Html: removed temp config dir: "%s".', self._bogus_dir) + self._bogus_dir = None + + def diff_for_file(self, path, log=None): + self._setup_bogus_dir(log) + try: + args = ['svn', 'diff'] + if self._bogus_dir: + args += ['--config-dir', self._bogus_dir] + args.append(path) + return self.run(args) + finally: + self._teardown_bogus_dir(log) + + def show_head(self, path): + return self.run(['svn', 'cat', '-r', 'BASE', path], decode_output=False) + def _repository_url(self): return self.value_from_svn_info(self.checkout_root, 'URL') @@ -435,6 +506,14 @@ class SVN(SCM): # http://svnbook.red-bean.com/en/1.0/ch03s03.html return self.svn_commit_log('BASE') + def propset(self, pname, pvalue, path): + dir, base = os.path.split(path) + return self.run(['svn', 'pset', pname, pvalue, base], cwd=dir) + + def propget(self, pname, path): + dir, base = os.path.split(path) + return self.run(['svn', 'pget', pname, base], cwd=dir).encode('utf-8').rstrip("\n") + # All git-specific logic should go here. class Git(SCM): def __init__(self, cwd): @@ -447,13 +526,18 @@ class Git(SCM): @classmethod def find_checkout_root(cls, path): # "git rev-parse --show-cdup" would be another way to get to the root - (checkout_root, dot_git) = os.path.split(run_command(['git', 'rev-parse', '--git-dir'], cwd=path)) + (checkout_root, dot_git) = os.path.split(run_command(['git', 'rev-parse', '--git-dir'], cwd=(path or "./"))) # If we were using 2.6 # checkout_root = os.path.relpath(checkout_root, path) if not os.path.isabs(checkout_root): # Sometimes git returns relative paths checkout_root = os.path.join(path, checkout_root) return checkout_root @classmethod + def to_object_name(cls, filepath): + root_end_with_slash = os.path.join(cls.find_checkout_root(os.path.dirname(filepath)), '') + return filepath.replace(root_end_with_slash, '') + + @classmethod def read_git_config(cls, key): # FIXME: This should probably use cwd=self.checkout_root. return run_command(["git", "config", key], @@ -494,9 +578,11 @@ class Git(SCM): def _status_regexp(self, expected_types): return '^(?P<status>[%s])\t(?P<filename>.+)$' % expected_types - def add(self, path): - # path is assumed to be cwd relative? - self.run(["git", "add", path]) + def add(self, path, return_exit_code=False): + return self.run(["git", "add", path], return_exit_code=return_exit_code) + + def delete(self, path): + return self.run(["git", "rm", "-f", path]) def _merge_base(self, git_commit, squash): if git_commit: @@ -537,6 +623,9 @@ class Git(SCM): def added_files(self): return self.run_status_and_extract_filenames(self.status_command(), self._status_regexp("A")) + def deleted_files(self): + return self.run_status_and_extract_filenames(self.status_command(), self._status_regexp("D")) + @staticmethod def supports_local_commits(): return True @@ -569,6 +658,12 @@ class Git(SCM): git_commit = self.git_commit_from_svn_revision(revision) return self.create_patch(git_commit) + def diff_for_file(self, path, log=None): + return self.run(['git', 'diff', 'HEAD', '--', path]) + + def show_head(self, path): + return self.run(['git', 'show', 'HEAD:' + self.to_object_name(path)], decode_output=False) + def committer_email_for_revision(self, revision): git_commit = self.git_commit_from_svn_revision(revision) committer_email = self.run(["git", "log", "-1", "--pretty=format:%ce", git_commit]) diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py b/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py index 36a1d1c..eaa3b46 100644 --- a/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py +++ b/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py @@ -40,6 +40,7 @@ import subprocess import tempfile import unittest import urllib +import shutil from datetime import date from webkitpy.common.checkout.api import Checkout @@ -63,8 +64,12 @@ def run_silent(args, cwd=None): def write_into_file_at_path(file_path, contents, encoding="utf-8"): - with codecs.open(file_path, "w", encoding) as file: - file.write(contents) + if encoding: + with codecs.open(file_path, "w", encoding) as file: + file.write(contents) + else: + with open(file_path, "w") as file: + file.write(contents) def read_from_path(file_path, encoding="utf-8"): @@ -388,6 +393,11 @@ OcmYex&reD$;sO8*F9L)B # Cannot delete again. self.assertRaises(ScriptError, self.checkout.apply_patch, self._create_patch(git_binary_deletion)) + def _shared_test_add_recursively(self): + os.mkdir("added_dir") + write_into_file_at_path("added_dir/added_file", "new stuff") + self.scm.add("added_dir/added_file") + self.assertTrue("added_dir/added_file" in self.scm.added_files()) class SVNTest(SCMTest): @@ -632,6 +642,60 @@ Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA== def test_committer_email_for_revision(self): self._shared_test_committer_email_for_revision() + def test_add_recursively(self): + self._shared_test_add_recursively() + + def test_delete(self): + os.chdir(self.svn_checkout_path) + self.scm.delete("test_file") + self.assertTrue("test_file" in self.scm.deleted_files()) + + def test_propset_propget(self): + filepath = os.path.join(self.svn_checkout_path, "test_file") + expected_mime_type = "x-application/foo-bar" + self.scm.propset("svn:mime-type", expected_mime_type, filepath) + self.assertEqual(expected_mime_type, self.scm.propget("svn:mime-type", filepath)) + + def test_show_head(self): + write_into_file_at_path("test_file", u"Hello!", "utf-8") + SVNTestRepository._svn_commit("fourth commit") + self.assertEqual("Hello!", self.scm.show_head('test_file')) + + def test_show_head_binary(self): + data = "\244" + write_into_file_at_path("binary_file", data, encoding=None) + self.scm.add("binary_file") + self.scm.commit_with_message("a test commit") + self.assertEqual(data, self.scm.show_head('binary_file')) + + def do_test_diff_for_file(self): + write_into_file_at_path('test_file', 'some content') + self.scm.commit_with_message("a test commit") + diff = self.scm.diff_for_file('test_file') + self.assertEqual(diff, "") + + write_into_file_at_path("test_file", "changed content") + diff = self.scm.diff_for_file('test_file') + self.assertTrue("-some content" in diff) + self.assertTrue("+changed content" in diff) + + def clean_bogus_dir(self): + self.bogus_dir = self.scm._bogus_dir_name() + if os.path.exists(self.bogus_dir): + shutil.rmtree(self.bogus_dir) + + def test_diff_for_file_with_existing_bogus_dir(self): + self.clean_bogus_dir() + os.mkdir(self.bogus_dir) + self.do_test_diff_for_file() + self.assertTrue(os.path.exists(self.bogus_dir)) + shutil.rmtree(self.bogus_dir) + + def test_diff_for_file_with_missing_bogus_dir(self): + self.clean_bogus_dir() + self.do_test_diff_for_file() + self.assertFalse(os.path.exists(self.bogus_dir)) + class GitTest(SCMTest): @@ -1098,6 +1162,46 @@ class GitSVNTest(SCMTest): def test_committer_email_for_revision(self): self._shared_test_committer_email_for_revision() + def test_add_recursively(self): + self._shared_test_add_recursively() + + def test_delete(self): + self._two_local_commits() + self.scm.delete('test_file_commit1') + self.assertTrue("test_file_commit1" in self.scm.deleted_files()) + + def test_to_object_name(self): + relpath = 'test_file_commit1' + fullpath = os.path.join(self.git_checkout_path, relpath) + self._two_local_commits() + self.assertEqual(relpath, self.scm.to_object_name(fullpath)) + + def test_show_head(self): + self._two_local_commits() + self.assertEqual("more test content", self.scm.show_head('test_file_commit1')) + + def test_show_head_binary(self): + self._two_local_commits() + data = "\244" + write_into_file_at_path("binary_file", data, encoding=None) + self.scm.add("binary_file") + self.scm.commit_locally_with_message("a test commit") + self.assertEqual(data, self.scm.show_head('binary_file')) + + def test_diff_for_file(self): + self._two_local_commits() + write_into_file_at_path('test_file_commit1', "Updated", encoding=None) + + diff = self.scm.diff_for_file('test_file_commit1') + cached_diff = self.scm.diff_for_file('test_file_commit1') + self.assertTrue("+Updated" in diff) + self.assertTrue("-more test content" in diff) + + self.scm.add('test_file_commit1') + + cached_diff = self.scm.diff_for_file('test_file_commit1') + self.assertTrue("+Updated" in cached_diff) + self.assertTrue("-more test content" in cached_diff) if __name__ == '__main__': unittest.main() diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py b/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py index f11b8a9..35f32d4 100644 --- a/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py +++ b/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py @@ -58,7 +58,9 @@ import urllib import webbrowser import zipfile -from webkitpy.common.system.executive import run_command +from webkitpy.common.system.executive import run_command, ScriptError +from webkitpy.common.checkout.scm import detect_scm_system +import webkitpy.common.checkout.scm as scm import port from layout_package import test_expectations @@ -68,9 +70,6 @@ from test_types import text_diff _log = logging.getLogger("webkitpy.layout_tests." "rebaseline_chromium_webkit_tests") -# Repository type constants. -REPO_SVN, REPO_UNKNOWN = range(2) - BASELINE_SUFFIXES = ['.txt', '.png', '.checksum'] REBASELINE_PLATFORM_ORDER = ['mac', 'win', 'win-xp', 'win-vista', 'linux'] ARCHIVE_DIR_NAME_DICT = {'win': 'webkit-rel', @@ -241,8 +240,7 @@ class Rebaseliner(object): self._platform, False, False) - - self._repo_type = self._get_repo_type() + self._scm = detect_scm_system(os.getcwd()) def run(self, backup): """Run rebaseline process.""" @@ -285,15 +283,6 @@ class Rebaseliner(object): def get_rebaselining_tests(self): return self._rebaselining_tests - # FIXME: Callers should use scm.py instead. - def _get_repo_type(self): - """Get the repository type that client is using.""" - return_code = run_command(['svn', 'info'], return_exit_code=True) - if return_code == 0: - return REPO_SVN - - return REPO_UNKNOWN - def _compile_rebaselining_tests(self): """Compile list of tests that need rebaselining for the platform. @@ -371,6 +360,9 @@ class Rebaseliner(object): None on failure """ + if self._options.force_archive_url: + return self._options.force_archive_url + dir_name = self._get_archive_dir_name(self._platform, self._options.webkit_canary) if not dir_name: @@ -431,7 +423,7 @@ class Rebaseliner(object): _log.info('Test %d: %s', test_no, test) found = False - svn_error = False + scm_error = False test_basename = os.path.splitext(test)[0] for suffix in BASELINE_SUFFIXES: archive_test_name = ('layout-test-results/%s-actual%s' % @@ -480,16 +472,17 @@ class Rebaseliner(object): shutil.move(temp_name, expected_fullpath) - if not self._svn_add(expected_fullpath): - svn_error = True + if 0 != self._scm.add(expected_fullpath, return_exit_code=True): + # FIXME: print detailed diagnose messages + scm_error = True elif suffix != '.checksum': self._create_html_baseline_files(expected_fullpath) if not found: _log.warn(' No new baselines found in archive.') else: - if svn_error: - _log.warn(' Failed to add baselines to SVN.') + if scm_error: + _log.warn(' Failed to add baselines to your repository.') else: _log.info(' Rebaseline succeeded.') self._rebaselined_tests.append(test) @@ -572,15 +565,7 @@ class Rebaseliner(object): if not filename or not os.path.isfile(filename): return - - if self._repo_type == REPO_SVN: - parent_dir, basename = os.path.split(filename) - original_dir = os.getcwd() - os.chdir(parent_dir) - run_shell(['svn', 'delete', '--force', basename], False) - os.chdir(original_dir) - else: - os.remove(filename) + self._scm.delete(filename) def _update_rebaselined_tests_in_file(self, backup): """Update the rebaselined tests in test expectations file. @@ -609,91 +594,10 @@ class Rebaseliner(object): # Or is new_expectations always a byte array? with open(path, "w") as file: file.write(new_expectations) + self._scm.add(path) else: _log.info('No test was rebaselined so nothing to remove.') - # FIXME: Callers should move to SCM.add instead. - def _svn_add(self, filename): - """Add the file to SVN repository. - - Args: - filename: full path of the file to add. - - Returns: - True if the file already exists in SVN or is sucessfully added - to SVN. - False otherwise. - """ - - if not filename: - return False - - parent_dir, basename = os.path.split(filename) - if self._repo_type != REPO_SVN or parent_dir == filename: - _log.info("No svn checkout found, skip svn add.") - return True - - original_dir = os.getcwd() - os.chdir(parent_dir) - status_output = run_shell(['svn', 'status', basename], False) - os.chdir(original_dir) - output = status_output.upper() - if output.startswith('A') or output.startswith('M'): - _log.info(' File already added to SVN: "%s"', filename) - return True - - if output.find('IS NOT A WORKING COPY') >= 0: - _log.info(' File is not a working copy, add its parent: "%s"', - parent_dir) - return self._svn_add(parent_dir) - - os.chdir(parent_dir) - add_output = run_shell(['svn', 'add', basename], True) - os.chdir(original_dir) - output = add_output.upper().rstrip() - if output.startswith('A') and output.find(basename.upper()) >= 0: - _log.info(' Added new file: "%s"', filename) - self._svn_prop_set(filename) - return True - - if (not status_output) and (add_output.upper().find( - 'ALREADY UNDER VERSION CONTROL') >= 0): - _log.info(' File already under SVN and has no change: "%s"', - filename) - return True - - _log.warn(' Failed to add file to SVN: "%s"', filename) - _log.warn(' Svn status output: "%s"', status_output) - _log.warn(' Svn add output: "%s"', add_output) - return False - - def _svn_prop_set(self, filename): - """Set the baseline property - - Args: - filename: full path of the file to add. - - Returns: - True if the file already exists in SVN or is sucessfully added - to SVN. - False otherwise. - """ - ext = os.path.splitext(filename)[1].upper() - if ext != '.TXT' and ext != '.PNG' and ext != '.CHECKSUM': - return - - parent_dir, basename = os.path.split(filename) - original_dir = os.getcwd() - os.chdir(parent_dir) - if ext == '.PNG': - cmd = ['svn', 'pset', 'svn:mime-type', 'image/png', basename] - else: - cmd = ['svn', 'pset', 'svn:eol-style', 'LF', basename] - - _log.debug(' Set svn prop: %s', ' '.join(cmd)) - run_shell(cmd, False) - os.chdir(original_dir) - def _create_html_baseline_files(self, baseline_fullpath): """Create baseline files (old, new and diff) in html directory. @@ -715,8 +619,13 @@ class Rebaseliner(object): _log.info(' Html: copied new baseline file from "%s" to "%s".', baseline_fullpath, new_file) - # Get the old baseline from SVN and save to the html directory. - output = run_shell(['svn', 'cat', '-r', 'BASE', baseline_fullpath]) + # Get the old baseline from the repository and save to the html directory. + try: + output = self._scm.show_head(baseline_fullpath) + except ScriptError, e: + _log.info(e) + output = "" + if (not output) or (output.upper().rstrip().endswith( 'NO SUCH FILE OR DIRECTORY')): _log.info(' No base file: "%s"', baseline_fullpath) @@ -733,27 +642,7 @@ class Rebaseliner(object): # Get the diff between old and new baselines and save to the html dir. if baseline_filename.upper().endswith('.TXT'): - # If the user specified a custom diff command in their svn config - # file, then it'll be used when we do svn diff, which we don't want - # to happen since we want the unified diff. Using --diff-cmd=diff - # doesn't always work, since they can have another diff executable - # in their path that gives different line endings. So we use a - # bogus temp directory as the config directory, which gets - # around these problems. - if sys.platform.startswith("win"): - parent_dir = tempfile.gettempdir() - else: - parent_dir = sys.path[0] # tempdir is not secure. - bogus_dir = os.path.join(parent_dir, "temp_svn_config") - _log.debug(' Html: temp config dir: "%s".', bogus_dir) - if not os.path.exists(bogus_dir): - os.mkdir(bogus_dir) - delete_bogus_dir = True - else: - delete_bogus_dir = False - - output = run_shell(["svn", "diff", "--config-dir", bogus_dir, - baseline_fullpath]) + output = self._scm.diff_for_file(baseline_fullpath, log=_log) if output: diff_file = get_result_file_fullpath( self._options.html_directory, baseline_filename, @@ -764,12 +653,6 @@ class Rebaseliner(object): _log.info(' Html: created baseline diff file: "%s".', diff_file) - if delete_bogus_dir: - shutil.rmtree(bogus_dir, True) - _log.debug(' Html: removed temp config dir: "%s".', - bogus_dir) - - class HtmlGenerator(object): """Class to generate rebaselining result comparison html.""" @@ -1001,6 +884,10 @@ def main(): default=False, help='include debug-level logging.') + option_parser.add_option('-q', '--quiet', + action='store_true', + help='Suppress result HTML viewing') + option_parser.add_option('-p', '--platforms', default='mac,win,win-xp,win-vista,linux', help=('Comma delimited list of platforms ' @@ -1011,6 +898,9 @@ def main(): 'layout_test_results'), help=('Url to find the layout test result archive' ' file.')) + option_parser.add_option('-U', '--force_archive_url', + help=('Url of result zip file. This option is for debugging ' + 'purposes')) option_parser.add_option('-w', '--webkit_canary', action='store_true', @@ -1106,7 +996,8 @@ def main(): rebaseline_platforms, rebaselining_tests) html_generator.generate_html() - html_generator.show_html() + if not options.quiet: + html_generator.show_html() log_dashed_string('Rebaselining result comparison done', None) sys.exit(0) diff --git a/WebKitTools/Scripts/webkitpy/style/checker.py b/WebKitTools/Scripts/webkitpy/style/checker.py index 5d75a1b..e3c56c5 100644 --- a/WebKitTools/Scripts/webkitpy/style/checker.py +++ b/WebKitTools/Scripts/webkitpy/style/checker.py @@ -205,7 +205,7 @@ _SKIPPED_FILES_WITH_WARNING = [ # The Qt API and tests do not follow WebKit style. # They follow Qt style. :) "gtk2drawing.c", # WebCore/platform/gtk/gtk2drawing.c - "gtk2drawing.h", # WebCore/platform/gtk/gtk2drawing.h + "gtkdrawing.h", # WebCore/platform/gtk/gtkdrawing.h "JavaScriptCore/qt/api/", "WebKit/gtk/tests/", "WebKit/qt/Api/", diff --git a/WebKitTools/Scripts/webkitpy/style/checker_unittest.py b/WebKitTools/Scripts/webkitpy/style/checker_unittest.py index e99ac68..5254275 100755 --- a/WebKitTools/Scripts/webkitpy/style/checker_unittest.py +++ b/WebKitTools/Scripts/webkitpy/style/checker_unittest.py @@ -281,10 +281,10 @@ class CheckerDispatcherSkipTest(unittest.TestCase): # Check skipped files. paths_to_skip = [ "gtk2drawing.c", - "gtk2drawing.h", + "gtkdrawing.h", "JavaScriptCore/qt/api/qscriptengine_p.h", "WebCore/platform/gtk/gtk2drawing.c", - "WebCore/platform/gtk/gtk2drawing.h", + "WebCore/platform/gtk/gtkdrawing.h", "WebKit/gtk/tests/testatk.c", "WebKit/qt/Api/qwebpage.h", "WebKit/qt/tests/qwebsecurityorigin/tst_qwebsecurityorigin.cpp", diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/download.py b/WebKitTools/Scripts/webkitpy/tool/commands/download.py index 17fb12c..59af16a 100644 --- a/WebKitTools/Scripts/webkitpy/tool/commands/download.py +++ b/WebKitTools/Scripts/webkitpy/tool/commands/download.py @@ -82,7 +82,6 @@ class Land(AbstractSequencedCommand): steps.EnsureBuildersAreGreen, steps.UpdateChangeLogsWithReviewer, steps.ValidateReviewer, - steps.EnsureBuildersAreGreen, steps.Build, steps.RunTests, steps.Commit, @@ -243,7 +242,6 @@ class AbstractPatchLandingCommand(AbstractPatchSequencingCommand): steps.Update, steps.ApplyPatch, steps.ValidateReviewer, - steps.EnsureBuildersAreGreen, steps.Build, steps.RunTests, steps.Commit, diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/upload.py b/WebKitTools/Scripts/webkitpy/tool/commands/upload.py index e682ca7..9c935e8 100644 --- a/WebKitTools/Scripts/webkitpy/tool/commands/upload.py +++ b/WebKitTools/Scripts/webkitpy/tool/commands/upload.py @@ -178,8 +178,13 @@ class Post(AbstractPatchUploadingCommand): class LandSafely(AbstractPatchUploadingCommand): name = "land-safely" - help_text = "Land the current diff via the commit-queue (Experimental)" + help_text = "Land the current diff via the commit-queue" argument_names = "[BUGID]" + long_help = """land-safely updates the ChangeLog with the reviewer listed + in bugs.webkit.org for BUGID (or the bug ID detected from the ChangeLog). + The command then uploads the current diff to the bug and marks it for + commit by the commit-queue.""" + show_in_main_help = True steps = [ steps.UpdateChangeLogsWithReviewer, steps.ObsoletePatches, diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/ensurebuildersaregreen.py b/WebKitTools/Scripts/webkitpy/tool/steps/ensurebuildersaregreen.py index 40bc302..7b717ef 100644 --- a/WebKitTools/Scripts/webkitpy/tool/steps/ensurebuildersaregreen.py +++ b/WebKitTools/Scripts/webkitpy/tool/steps/ensurebuildersaregreen.py @@ -28,7 +28,7 @@ from webkitpy.tool.steps.abstractstep import AbstractStep from webkitpy.tool.steps.options import Options -from webkitpy.common.system.deprecated_logging import error +from webkitpy.common.system.deprecated_logging import log, error class EnsureBuildersAreGreen(AbstractStep): @@ -45,4 +45,6 @@ class EnsureBuildersAreGreen(AbstractStep): if not red_builders_names: return red_builders_names = map(lambda name: "\"%s\"" % name, red_builders_names) # Add quotes around the names. - error("Builders [%s] are red, please do not commit.\nSee http://%s.\nPass --ignore-builders to bypass this check." % (", ".join(red_builders_names), self._tool.buildbot.buildbot_host)) + log("\nBuilders [%s] are red, please do not commit.\nSee http://%s/console?category=core\n" % (", ".join(red_builders_names), self._tool.buildbot.buildbot_host)) + if not self._tool.user.confirm("Are you sure you want to continue?"): + error("User aborted.") |