summaryrefslogtreecommitdiff
path: root/Tools/Scripts/webkitpy/tool/commands/upload.py
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-11-29 12:18:48 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2012-11-29 12:18:57 +0100
commit4c01d0526ba4dd8cff0c0ff22a6f0ab5eb973064 (patch)
treebed2fe914fe0f7ec70abfb47d2d84af8a3604d09 /Tools/Scripts/webkitpy/tool/commands/upload.py
parent01485457c9a5da3f1121015afd25bb53af77662e (diff)
downloadqtwebkit-4c01d0526ba4dd8cff0c0ff22a6f0ab5eb973064.tar.gz
Imported WebKit commit c60cfe0fc09efd257aa0111d7b133b02deb8a63e (http://svn.webkit.org/repository/webkit/trunk@136119)
New snapshot that includes the fix for installing the QtWebProcess into libexec Change-Id: I01344e079cbdac5678c4cba6ffcc05f4597cf0d7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'Tools/Scripts/webkitpy/tool/commands/upload.py')
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/upload.py40
1 files changed, 24 insertions, 16 deletions
diff --git a/Tools/Scripts/webkitpy/tool/commands/upload.py b/Tools/Scripts/webkitpy/tool/commands/upload.py
index 6b52e6c83..5cd0de9e0 100644
--- a/Tools/Scripts/webkitpy/tool/commands/upload.py
+++ b/Tools/Scripts/webkitpy/tool/commands/upload.py
@@ -28,6 +28,7 @@
# (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 logging
import os
import re
import sys
@@ -38,7 +39,6 @@ from webkitpy.tool import steps
from webkitpy.common.checkout.changelog import parse_bug_id_from_changelog
from webkitpy.common.config.committers import CommitterList
-from webkitpy.common.system.deprecated_logging import error, log
from webkitpy.common.system.user import User
from webkitpy.thirdparty.mock import Mock
from webkitpy.tool.commands.abstractsequencedcommand import AbstractSequencedCommand
@@ -46,6 +46,8 @@ from webkitpy.tool.comments import bug_comment_from_svn_revision
from webkitpy.tool.grammar import pluralize, join_with_separators
from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand
+_log = logging.getLogger(__name__)
+
class CommitMessageForCurrentDiff(AbstractDeclarativeCommand):
name = "commit-message"
@@ -133,24 +135,24 @@ class AssignToCommitter(AbstractDeclarativeCommand):
bug = self._tool.bugs.fetch_bug(bug_id)
if not bug.is_unassigned():
assigned_to_email = bug.assigned_to_email()
- log(u"Bug %s is already assigned to %s (%s)." % (bug_id, assigned_to_email, committers.committer_by_email(assigned_to_email)))
+ _log.info(u"Bug %s is already assigned to %s (%s)." % (bug_id, assigned_to_email, committers.committer_by_email(assigned_to_email)))
return
reviewed_patches = bug.reviewed_patches()
if not reviewed_patches:
- log("Bug %s has no non-obsolete patches, ignoring." % bug_id)
+ _log.info("Bug %s has no non-obsolete patches, ignoring." % bug_id)
return
# We only need to do anything with this bug if one of the r+'d patches does not have a valid committer (cq+ set).
if self._patches_have_commiters(reviewed_patches):
- log("All reviewed patches on bug %s already have commit-queue+, ignoring." % bug_id)
+ _log.info("All reviewed patches on bug %s already have commit-queue+, ignoring." % bug_id)
return
latest_patch = reviewed_patches[-1]
attacher_email = latest_patch.attacher_email()
committer = committers.committer_by_email(attacher_email)
if not committer:
- log("Attacher %s is not a committer. Bug %s likely needs commit-queue+." % (attacher_email, bug_id))
+ _log.info("Attacher %s is not a committer. Bug %s likely needs commit-queue+." % (attacher_email, bug_id))
return
reassign_message = u"Attachment %s was posted by a committer and has review+, assigning to %s for commit." % (latest_patch.id(), committer.full_name)
@@ -202,7 +204,8 @@ class AbstractPatchUploadingCommand(AbstractSequencedCommand):
state = {}
state["bug_id"] = self._bug_id(options, args, tool, state)
if not state["bug_id"]:
- error("No bug id passed and no bug url found in ChangeLogs.")
+ _log.error("No bug id passed and no bug url found in ChangeLogs.")
+ sys.exit(1)
return state
@@ -322,7 +325,8 @@ class PostCommits(AbstractDeclarativeCommand):
def execute(self, options, args, tool):
commit_ids = tool.scm().commit_ids_from_commitish_arguments(args)
if len(commit_ids) > 10: # We could lower this limit, 10 is too many for one bug as-is.
- error("webkit-patch does not support attaching %s at once. Are you sure you passed the right commit range?" % (pluralize("patch", len(commit_ids))))
+ _log.error("webkit-patch does not support attaching %s at once. Are you sure you passed the right commit range?" % (pluralize("patch", len(commit_ids))))
+ sys.exit(1)
have_obsoleted_patches = set()
for commit_id in commit_ids:
@@ -331,7 +335,7 @@ class PostCommits(AbstractDeclarativeCommand):
# Prefer --bug-id=, then a bug url in the commit message, then a bug url in the entire commit diff (i.e. ChangeLogs).
bug_id = options.bug_id or parse_bug_id_from_changelog(commit_message.message()) or parse_bug_id_from_changelog(tool.scm().create_patch(git_commit=commit_id))
if not bug_id:
- log("Skipping %s: No bug id found in commit or specified with --bug-id." % commit_id)
+ _log.info("Skipping %s: No bug id found in commit or specified with --bug-id." % commit_id)
continue
if options.obsolete_patches and bug_id not in have_obsoleted_patches:
@@ -382,8 +386,9 @@ class MarkBugFixed(AbstractDeclarativeCommand):
not_found.append("bug id")
if not svn_revision:
not_found.append("svn revision")
- error("Could not find %s on command-line or in %s."
+ _log.error("Could not find %s on command-line or in %s."
% (" or ".join(not_found), "r%s" % svn_revision if svn_revision else "last commit"))
+ sys.exit(1)
return (bug_id, svn_revision)
@@ -395,15 +400,16 @@ class MarkBugFixed(AbstractDeclarativeCommand):
if re.match("^r[0-9]+$", svn_revision, re.IGNORECASE):
svn_revision = svn_revision[1:]
if not re.match("^[0-9]+$", svn_revision):
- error("Invalid svn revision: '%s'" % svn_revision)
+ _log.error("Invalid svn revision: '%s'" % svn_revision)
+ sys.exit(1)
needs_prompt = False
if not bug_id or not svn_revision:
needs_prompt = True
(bug_id, svn_revision) = self._determine_bug_id_and_svn_revision(tool, bug_id, svn_revision)
- log("Bug: <%s> %s" % (tool.bugs.bug_url_for_bug_id(bug_id), tool.bugs.fetch_bug_dictionary(bug_id)["title"]))
- log("Revision: %s" % svn_revision)
+ _log.info("Bug: <%s> %s" % (tool.bugs.bug_url_for_bug_id(bug_id), tool.bugs.fetch_bug_dictionary(bug_id)["title"]))
+ _log.info("Revision: %s" % svn_revision)
if options.open_bug:
tool.user.open_url(tool.bugs.bug_url_for_bug_id(bug_id))
@@ -417,10 +423,10 @@ class MarkBugFixed(AbstractDeclarativeCommand):
bug_comment = "%s\n\n%s" % (options.comment, bug_comment)
if options.update_only:
- log("Adding comment to Bug %s." % bug_id)
+ _log.info("Adding comment to Bug %s." % bug_id)
tool.bugs.post_comment_to_bug(bug_id, bug_comment)
else:
- log("Adding comment to Bug %s and marking as Resolved/Fixed." % bug_id)
+ _log.info("Adding comment to Bug %s and marking as Resolved/Fixed." % bug_id)
tool.bugs.close_bug_as_fixed(bug_id, bug_comment)
@@ -443,7 +449,8 @@ class CreateBug(AbstractDeclarativeCommand):
def create_bug_from_commit(self, options, args, tool):
commit_ids = tool.scm().commit_ids_from_commitish_arguments(args)
if len(commit_ids) > 3:
- error("Are you sure you want to create one bug with %s patches?" % len(commit_ids))
+ _log.error("Are you sure you want to create one bug with %s patches?" % len(commit_ids))
+ sys.exit(1)
commit_id = commit_ids[0]
@@ -499,7 +506,8 @@ class CreateBug(AbstractDeclarativeCommand):
def execute(self, options, args, tool):
if len(args):
if (not tool.scm().supports_local_commits()):
- error("Extra arguments not supported; patch is taken from working directory.")
+ _log.error("Extra arguments not supported; patch is taken from working directory.")
+ sys.exit(1)
self.create_bug_from_commit(options, args, tool)
else:
self.create_bug_from_patch(options, args, tool)