[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.16-1409-g5afdf4d
abarth at webkit.org
abarth at webkit.org
Thu Dec 3 13:45:53 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit 0769811bf71361a19314bf9c1aee6fb303784576
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Nov 27 08:04:38 2009 +0000
2009-11-27 Adam Barth <abarth at webkit.org>
Reviewed by Eric Seidel.
[bzt] Kill WebKitLandingScripts
https://bugs.webkit.org/show_bug.cgi?id=31904
Step 6: Kill the rest.
* Scripts/modules/buildsteps.py:
* Scripts/modules/commands/download.py:
* Scripts/modules/commands/queries.py:
* Scripts/modules/commands/upload.py:
* Scripts/modules/landingsequence.py:
* Scripts/modules/scm.py:
* Scripts/modules/webkitlandingscripts.py: Removed.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51437 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index f9f85b2..27df7d3 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -2,6 +2,23 @@
Reviewed by Eric Seidel.
+ [bzt] Kill WebKitLandingScripts
+ https://bugs.webkit.org/show_bug.cgi?id=31904
+
+ Step 6: Kill the rest.
+
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/commands/download.py:
+ * Scripts/modules/commands/queries.py:
+ * Scripts/modules/commands/upload.py:
+ * Scripts/modules/landingsequence.py:
+ * Scripts/modules/scm.py:
+ * Scripts/modules/webkitlandingscripts.py: Removed.
+
+2009-11-27 Adam Barth <abarth at webkit.org>
+
+ Reviewed by Eric Seidel.
+
[bzt] Unit test upload commands
https://bugs.webkit.org/show_bug.cgi?id=31903
diff --git a/WebKitTools/Scripts/modules/buildsteps.py b/WebKitTools/Scripts/modules/buildsteps.py
index 07dc63d..5c50fbf 100644
--- a/WebKitTools/Scripts/modules/buildsteps.py
+++ b/WebKitTools/Scripts/modules/buildsteps.py
@@ -28,12 +28,38 @@
import os
+from optparse import make_option
+
from modules.logging import log, error
from modules.processutils import run_and_throw_if_fail
-from modules.webkitlandingscripts import WebKitLandingScripts
from modules.webkitport import WebKitPort
class BuildSteps:
+ # FIXME: The options should really live on each "Step" object.
+ @staticmethod
+ def cleaning_options():
+ return [
+ make_option("--force-clean", action="store_true", dest="force_clean", default=False, help="Clean working directory before applying patches (removes local changes and commits)"),
+ make_option("--no-clean", action="store_false", dest="clean", default=True, help="Don't check if the working directory is clean before applying patches"),
+ ]
+
+ @staticmethod
+ def build_options():
+ return [
+ make_option("--ignore-builders", action="store_false", dest="check_builders", default=True, help="Don't check to see if the build.webkit.org builders are green before landing."),
+ make_option("--quiet", action="store_true", dest="quiet", default=False, help="Produce less console output."),
+ make_option("--non-interactive", action="store_true", dest="non_interactive", default=False, help="Never prompt the user, fail as fast as possible."),
+ ] + WebKitPort.port_options()
+
+ @staticmethod
+ def land_options():
+ return [
+ make_option("--no-update", action="store_false", dest="update", default=True, help="Don't update the working directory."),
+ make_option("--no-build", action="store_false", dest="build", default=True, help="Commit without building first, implies --no-test."),
+ make_option("--no-test", action="store_false", dest="test", default=True, help="Commit without running run-webkit-tests."),
+ make_option("--no-close", action="store_false", dest="close_bug", default=True, help="Leave bug open after landing."),
+ ]
+
def _run_script(cls, script_name, quiet=False, port=WebKitPort):
log("Running %s" % script_name)
run_and_throw_if_fail(port.script_path(script_name), quiet)
diff --git a/WebKitTools/Scripts/modules/commands/download.py b/WebKitTools/Scripts/modules/commands/download.py
index d986e28..98a8ebb 100644
--- a/WebKitTools/Scripts/modules/commands/download.py
+++ b/WebKitTools/Scripts/modules/commands/download.py
@@ -41,6 +41,7 @@ from optparse import make_option
from modules.bugzilla import Bugzilla, parse_bug_id
from modules.buildbot import BuildBot
+from modules.buildsteps import BuildSteps
from modules.changelogs import ChangeLog
from modules.comments import bug_comment_from_commit_text
from modules.grammar import pluralize
@@ -50,7 +51,6 @@ from modules.multicommandtool import MultiCommandTool, Command
from modules.patchcollection import PatchCollection
from modules.scm import CommitMessage, detect_scm_system, ScriptError, CheckoutNeedsUpdate
from modules.statusbot import StatusBot
-from modules.webkitlandingscripts import WebKitLandingScripts, commit_message_for_this_commit
from modules.webkitport import WebKitPort
from modules.workqueue import WorkQueue, WorkQueueDelegate
@@ -69,9 +69,9 @@ class Build(Command):
name = "build"
show_in_main_help = False
def __init__(self):
- options = WebKitLandingScripts.cleaning_options()
- options += WebKitLandingScripts.build_options()
- options += WebKitLandingScripts.land_options()
+ options = BuildSteps.cleaning_options()
+ options += BuildSteps.build_options()
+ options += BuildSteps.land_options()
Command.__init__(self, "Update working copy and build", "", options)
def execute(self, options, args, tool):
@@ -83,7 +83,8 @@ class ApplyAttachment(Command):
name = "apply-attachment"
show_in_main_help = True
def __init__(self):
- options = WebKitApplyingScripts.apply_options() + WebKitLandingScripts.cleaning_options()
+ options = WebKitApplyingScripts.apply_options()
+ options += BuildSteps.cleaning_options()
Command.__init__(self, "Apply an attachment to the local working directory", "ATTACHMENT_ID", options=options)
def execute(self, options, args, tool):
@@ -97,7 +98,8 @@ class ApplyPatches(Command):
name = "apply-patches"
show_in_main_help = True
def __init__(self):
- options = WebKitApplyingScripts.apply_options() + WebKitLandingScripts.cleaning_options()
+ options = WebKitApplyingScripts.apply_options()
+ options += BuildSteps.cleaning_options()
Command.__init__(self, "Apply reviewed patches from provided bugs to the local working directory", "BUGID", options=options)
def execute(self, options, args, tool):
@@ -130,7 +132,7 @@ class WebKitApplyingScripts:
log("Applying attachment %s from bug %s" % (patch["id"], patch["bug_id"]))
scm.apply_patch(patch)
if options.local_commit:
- commit_message = commit_message_for_this_commit(scm)
+ commit_message = scm.commit_message_for_this_commit()
scm.commit_locally_with_message(commit_message.message() or patch["name"])
@@ -167,8 +169,8 @@ class LandDiff(Command):
options = [
make_option("-r", "--reviewer", action="store", type="string", dest="reviewer", help="Update ChangeLogs to say Reviewed by REVIEWER."),
]
- options += WebKitLandingScripts.build_options()
- options += WebKitLandingScripts.land_options()
+ options += BuildSteps.build_options()
+ options += BuildSteps.land_options()
Command.__init__(self, "Land the current working directory diff and updates the associated bug if any", "[BUGID]", options=options)
def guess_reviewer_from_bug(self, bugs, bug_id):
@@ -261,8 +263,8 @@ class CheckStyle(AbstractPatchProcessingCommand):
name = "check-style"
show_in_main_help = False
def __init__(self):
- options = WebKitLandingScripts.cleaning_options()
- options += WebKitLandingScripts.build_options()
+ options = BuildSteps.cleaning_options()
+ options += BuildSteps.build_options()
AbstractPatchProcessingCommand.__init__(self, "Run check-webkit-style on the specified attachments", "ATTACHMENT_ID [ATTACHMENT_IDS]", options)
def _fetch_list_of_patches_to_process(self, options, args, tool):
@@ -291,8 +293,8 @@ class BuildAttachment(AbstractPatchProcessingCommand):
name = "build-attachment"
show_in_main_help = False
def __init__(self):
- options = WebKitLandingScripts.cleaning_options()
- options += WebKitLandingScripts.build_options()
+ options = BuildSteps.cleaning_options()
+ options += BuildSteps.build_options()
AbstractPatchProcessingCommand.__init__(self, "Apply and build patches from bugzilla", "ATTACHMENT_ID [ATTACHMENT_IDS]", options)
def _fetch_list_of_patches_to_process(self, options, args, tool):
@@ -309,9 +311,9 @@ class BuildAttachment(AbstractPatchProcessingCommand):
class AbstractPatchLandingCommand(AbstractPatchProcessingCommand):
def __init__(self, help_text, args_description):
- options = WebKitLandingScripts.cleaning_options()
- options += WebKitLandingScripts.build_options()
- options += WebKitLandingScripts.land_options()
+ options = BuildSteps.cleaning_options()
+ options += BuildSteps.build_options()
+ options += BuildSteps.land_options()
AbstractPatchProcessingCommand.__init__(self, help_text, args_description, options)
def _prepare_to_process(self, options, args, tool):
@@ -352,9 +354,9 @@ class Rollout(Command):
name = "rollout"
show_in_main_help = True
def __init__(self):
- options = WebKitLandingScripts.cleaning_options()
- options += WebKitLandingScripts.build_options()
- options += WebKitLandingScripts.land_options()
+ options = BuildSteps.cleaning_options()
+ options += BuildSteps.build_options()
+ options += BuildSteps.land_options()
options.append(make_option("--complete-rollout", action="store_true", dest="complete_rollout", help="Commit the revert and re-open the original bug."))
Command.__init__(self, "Revert the given revision in the working copy and optionally commit the revert and re-open the original bug", "REVISION [BUGID]", options=options)
@@ -402,5 +404,7 @@ class Rollout(Command):
if not options.complete_rollout:
log("\nNOTE: Rollout support is experimental.\nPlease verify the rollout diff and use \"bugzilla-tool land-diff %s\" to commit the rollout." % bug_id)
else:
- comment_text = WebKitLandingScripts.build_and_commit(tool.scm(), options)
+ # FIXME: This function does not exist!!
+ # comment_text = WebKitLandingScripts.build_and_commit(tool.scm(), options)
+ raise ScriptError("OOPS! This option is not implemented (yet).")
self._reopen_bug_after_rollout(tool, bug_id, comment_text)
diff --git a/WebKitTools/Scripts/modules/commands/queries.py b/WebKitTools/Scripts/modules/commands/queries.py
index 2e66afb..2c81725 100644
--- a/WebKitTools/Scripts/modules/commands/queries.py
+++ b/WebKitTools/Scripts/modules/commands/queries.py
@@ -50,7 +50,6 @@ from modules.multicommandtool import MultiCommandTool, Command
from modules.patchcollection import PatchCollection
from modules.scm import CommitMessage, detect_scm_system, ScriptError, CheckoutNeedsUpdate
from modules.statusbot import StatusBot
-from modules.webkitlandingscripts import WebKitLandingScripts, commit_message_for_this_commit
from modules.webkitport import WebKitPort
from modules.workqueue import WorkQueue, WorkQueueDelegate
diff --git a/WebKitTools/Scripts/modules/commands/upload.py b/WebKitTools/Scripts/modules/commands/upload.py
index e885623..5126153 100644
--- a/WebKitTools/Scripts/modules/commands/upload.py
+++ b/WebKitTools/Scripts/modules/commands/upload.py
@@ -50,11 +50,10 @@ from modules.multicommandtool import MultiCommandTool, Command
from modules.patchcollection import PatchCollection
from modules.scm import CommitMessage, detect_scm_system, ScriptError, CheckoutNeedsUpdate
from modules.statusbot import StatusBot
-from modules.webkitlandingscripts import WebKitLandingScripts, commit_message_for_this_commit
from modules.webkitport import WebKitPort
from modules.workqueue import WorkQueue, WorkQueueDelegate
-# FIXME: Requires unit test. Blocking issue: commit_message_for_this_commit.
+# FIXME: Requires unit test.
class CommitMessageForCurrentDiff(Command):
name = "commit-message"
show_in_main_help = False
@@ -63,7 +62,7 @@ class CommitMessageForCurrentDiff(Command):
def execute(self, options, args, tool):
os.chdir(tool.scm().checkout_root)
- print "%s" % commit_message_for_this_commit(tool.scm()).message()
+ print "%s" % tool.scm().commit_message_for_this_commit().message()
class ObsoleteAttachments(Command):
@@ -229,7 +228,7 @@ class CreateBug(Command):
if options.prompt:
(bug_title, comment_text) = self.prompt_for_bug_title_and_comment()
else:
- commit_message = commit_message_for_this_commit(tool.scm())
+ commit_message = tool.scm().commit_message_for_this_commit()
bug_title = commit_message.description(lstrip=True, strip_url=True)
comment_text = commit_message.body(lstrip=True)
diff --git a/WebKitTools/Scripts/modules/landingsequence.py b/WebKitTools/Scripts/modules/landingsequence.py
index fbf5e95..0d283e6 100644
--- a/WebKitTools/Scripts/modules/landingsequence.py
+++ b/WebKitTools/Scripts/modules/landingsequence.py
@@ -31,7 +31,6 @@
from modules.comments import bug_comment_from_commit_text
from modules.logging import log
from modules.scm import ScriptError, CheckoutNeedsUpdate
-from modules.webkitlandingscripts import WebKitLandingScripts, commit_message_for_this_commit
from modules.webkitport import WebKitPort
from modules.workqueue import WorkQueue
@@ -88,7 +87,7 @@ class LandingSequence:
self._tool.run_tests(launch_safari=not self._options.non_interactive, fail_fast=self._options.non_interactive, quiet=self._options.quiet, port=self._port)
def commit(self):
- commit_message = commit_message_for_this_commit(self._tool.scm())
+ commit_message = self._tool.scm().commit_message_for_this_commit()
return self._tool.scm().commit_with_message(commit_message.message())
def close_patch(self, commit_log):
diff --git a/WebKitTools/Scripts/modules/scm.py b/WebKitTools/Scripts/modules/scm.py
index ad95d26..d322762 100644
--- a/WebKitTools/Scripts/modules/scm.py
+++ b/WebKitTools/Scripts/modules/scm.py
@@ -34,6 +34,7 @@ import re
import subprocess
# Import WebKit-specific modules.
+from modules.changelogs import ChangeLog
from modules.logging import error, log
def detect_scm_system(path):
@@ -210,6 +211,28 @@ class SCM:
changelog_paths.append(path)
return changelog_paths
+ # FIXME: Requires unit test
+ # FIXME: commit_message_for_this_commit and modified_changelogs don't
+ # really belong here. We should have a separate module for
+ # handling ChangeLogs.
+ def commit_message_for_this_commit(self):
+ changelog_paths = self.modified_changelogs()
+ if not len(changelog_paths):
+ raise ScriptError(message="Found no modified ChangeLogs, cannot create a commit message.\n"
+ "All changes require a ChangeLog. See:\n"
+ "http://webkit.org/coding/contributing.html")
+
+ changelog_messages = []
+ for changelog_path in changelog_paths:
+ log("Parsing ChangeLog: %s" % changelog_path)
+ changelog_entry = ChangeLog(changelog_path).latest_entry()
+ if not changelog_entry:
+ raise ScriptError(message="Failed to parse ChangeLog: " + os.path.abspath(changelog_path))
+ changelog_messages.append(changelog_entry)
+
+ # FIXME: We should sort and label the ChangeLog messages like commit-log-editor does.
+ return CommitMessage("".join(changelog_messages).splitlines())
+
@staticmethod
def in_working_directory(path):
raise NotImplementedError, "subclasses must implement"
diff --git a/WebKitTools/Scripts/modules/webkitlandingscripts.py b/WebKitTools/Scripts/modules/webkitlandingscripts.py
deleted file mode 100644
index 96aa47b..0000000
--- a/WebKitTools/Scripts/modules/webkitlandingscripts.py
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2009, Google Inc. All rights reserved.
-# Copyright (c) 2009 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:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * 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.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# 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 os
-import StringIO
-import subprocess
-import sys
-
-from optparse import make_option
-
-from modules.changelogs import ChangeLog
-from modules.logging import error, log, tee
-from modules.scm import CommitMessage, detect_scm_system, ScriptError, CheckoutNeedsUpdate
-from modules.webkitport import WebKitPort
-
-def commit_message_for_this_commit(scm):
- changelog_paths = scm.modified_changelogs()
- if not len(changelog_paths):
- raise ScriptError(message="Found no modified ChangeLogs, cannot create a commit message.\n"
- "All changes require a ChangeLog. See:\n"
- "http://webkit.org/coding/contributing.html")
-
- changelog_messages = []
- for changelog_path in changelog_paths:
- log("Parsing ChangeLog: %s" % changelog_path)
- changelog_entry = ChangeLog(changelog_path).latest_entry()
- if not changelog_entry:
- raise ScriptError(message="Failed to parse ChangeLog: " + os.path.abspath(changelog_path))
- changelog_messages.append(changelog_entry)
-
- # FIXME: We should sort and label the ChangeLog messages like commit-log-editor does.
- return CommitMessage("".join(changelog_messages).splitlines())
-
-
-class WebKitLandingScripts:
- @staticmethod
- def cleaning_options():
- return [
- make_option("--force-clean", action="store_true", dest="force_clean", default=False, help="Clean working directory before applying patches (removes local changes and commits)"),
- make_option("--no-clean", action="store_false", dest="clean", default=True, help="Don't check if the working directory is clean before applying patches"),
- ]
-
- @staticmethod
- def build_options():
- return [
- make_option("--ignore-builders", action="store_false", dest="check_builders", default=True, help="Don't check to see if the build.webkit.org builders are green before landing."),
- make_option("--quiet", action="store_true", dest="quiet", default=False, help="Produce less console output."),
- make_option("--non-interactive", action="store_true", dest="non_interactive", default=False, help="Never prompt the user, fail as fast as possible."),
- ] + WebKitPort.port_options()
-
- @staticmethod
- def land_options():
- return [
- make_option("--no-update", action="store_false", dest="update", default=True, help="Don't update the working directory."),
- make_option("--no-build", action="store_false", dest="build", default=True, help="Commit without building first, implies --no-test."),
- make_option("--no-test", action="store_false", dest="test", default=True, help="Commit without running run-webkit-tests."),
- make_option("--no-close", action="store_false", dest="close_bug", default=True, help="Leave bug open after landing."),
- ]
-
-
-
-
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list