[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf
abarth at webkit.org
abarth at webkit.org
Wed Jan 6 00:17:23 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 7f19552dda7603d88e3b340afcb9ed8132697531
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Jan 4 10:46:42 2010 +0000
2010-01-04 Adam Barth <abarth at webkit.org>
Reviewed by Eric Seidel.
Add unit test for MarkBugFixed
https://bugs.webkit.org/show_bug.cgi?id=33142
MarkBugFixed is way behind in command technology, but it still needs a
unit test, as the FIXME commands.
Also, remove mark-bug-fixed and create-bug from main help since we have
more modern commands to replace them.
* Scripts/webkitpy/commands/upload.py:
* Scripts/webkitpy/commands/upload_unittest.py:
* Scripts/webkitpy/mock_bugzillatool.py:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52724 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 464c8f8..46146d7 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -2,6 +2,23 @@
Reviewed by Eric Seidel.
+ Add unit test for MarkBugFixed
+ https://bugs.webkit.org/show_bug.cgi?id=33142
+
+ MarkBugFixed is way behind in command technology, but it still needs a
+ unit test, as the FIXME commands.
+
+ Also, remove mark-bug-fixed and create-bug from main help since we have
+ more modern commands to replace them.
+
+ * Scripts/webkitpy/commands/upload.py:
+ * Scripts/webkitpy/commands/upload_unittest.py:
+ * Scripts/webkitpy/mock_bugzillatool.py:
+
+2010-01-04 Adam Barth <abarth at webkit.org>
+
+ Reviewed by Eric Seidel.
+
Add missing unit test for CommitMessageForCurrentDiff
https://bugs.webkit.org/show_bug.cgi?id=33141
diff --git a/WebKitTools/Scripts/webkitpy/commands/upload.py b/WebKitTools/Scripts/webkitpy/commands/upload.py
index 7a216a3..abfd0a4 100644
--- a/WebKitTools/Scripts/webkitpy/commands/upload.py
+++ b/WebKitTools/Scripts/webkitpy/commands/upload.py
@@ -226,10 +226,8 @@ class PostCommits(AbstractDeclarativeCommmand):
tool.bugs.add_patch_to_bug(bug_id, diff_file, description, comment_text, mark_for_review=options.review, mark_for_commit_queue=options.request_commit)
-# FIXME: Requires unit test. Blocking issue: too complex for now.
class MarkBugFixed(AbstractDeclarativeCommmand):
name = "mark-bug-fixed"
- show_in_main_help = True
help_text = "Mark the specified bug as fixed"
argument_names = "[SVN_REVISION]"
def __init__(self):
@@ -268,17 +266,6 @@ class MarkBugFixed(AbstractDeclarativeCommmand):
return (bug_id, svn_revision)
- def _open_bug_in_web_browser(self, tool, bug_id):
- if sys.platform == "darwin":
- tool.executive.run_command(["open", tool.bugs.short_bug_url_for_bug_id(bug_id)])
- return
- log("WARNING: --open is only supported on Mac OS X.")
-
- def _prompt_user_for_correctness(self, bug_id, svn_revision):
- answer = raw_input("Is this correct (y/N)? ")
- if not re.match("^\s*y(es)?", answer, re.IGNORECASE):
- exit(1)
-
def execute(self, options, args, tool):
bug_id = options.bug_id
@@ -294,14 +281,15 @@ class MarkBugFixed(AbstractDeclarativeCommmand):
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.short_bug_url_for_bug_id(bug_id), tool.bugs.fetch_bug_dictionary(bug_id)["title"]))
+ 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)
if options.open_bug:
- self._open_bug_in_web_browser(tool, bug_id)
+ tool.user.open_url(tool.bugs.bug_url_for_bug_id(bug_id))
if needs_prompt:
- self._prompt_user_for_correctness(bug_id, svn_revision)
+ if not tool.user.confirm("Is this correct?"):
+ exit(1)
bug_comment = bug_comment_from_svn_revision(svn_revision)
if options.comment:
@@ -318,7 +306,6 @@ class MarkBugFixed(AbstractDeclarativeCommmand):
# FIXME: Requires unit test. Blocking issue: too complex for now.
class CreateBug(AbstractDeclarativeCommmand):
name = "create-bug"
- show_in_main_help = True
help_text = "Create a bug from local changes or local commits"
argument_names = "[COMMITISH]"
diff --git a/WebKitTools/Scripts/webkitpy/commands/upload_unittest.py b/WebKitTools/Scripts/webkitpy/commands/upload_unittest.py
index b30935f..217c2d2 100644
--- a/WebKitTools/Scripts/webkitpy/commands/upload_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/commands/upload_unittest.py
@@ -30,6 +30,7 @@ import unittest
from webkitpy.commands.commandtest import CommandsTest
from webkitpy.commands.upload import *
+from webkitpy.mock import Mock
from webkitpy.mock_bugzillatool import MockBugzillaTool
class UploadCommandsTest(CommandsTest):
@@ -65,5 +66,13 @@ class UploadCommandsTest(CommandsTest):
expected_stderr = "Obsoleting 2 old patches on bug 42\n"
self.assert_execute_outputs(SubmitPatch(), [42], expected_stderr=expected_stderr)
+ def test_mark_bug_fixed(self):
+ tool = MockBugzillaTool()
+ tool._scm.last_svn_commit_log = lambda: "r9876 |"
+ options = Mock()
+ options.bug_id = 42
+ expected_stderr = "Bug: <http://example.com/42> The first bug\nRevision: 9876\nAdding comment to Bug 42.\n"
+ self.assert_execute_outputs(MarkBugFixed(), [], expected_stderr=expected_stderr, tool=tool, options=options)
+
def test_edit_changelog(self):
self.assert_execute_outputs(EditChangeLog(), [])
diff --git a/WebKitTools/Scripts/webkitpy/mock_bugzillatool.py b/WebKitTools/Scripts/webkitpy/mock_bugzillatool.py
index 39dba7d..f8392aa 100644
--- a/WebKitTools/Scripts/webkitpy/mock_bugzillatool.py
+++ b/WebKitTools/Scripts/webkitpy/mock_bugzillatool.py
@@ -64,16 +64,19 @@ _unassigned_email = "unassigned at example.com"
# FIXME: The ids should be 1, 2, 3 instead of crazy numbers.
_bug1 = {
"id" : 42,
+ "title" : "The first bug",
"assigned_to_email" : _unassigned_email,
"attachments" : [_patch1, _patch2],
}
_bug2 = {
"id" : 75,
+ "title" : "The second bug",
"assigned_to_email" : "foo at foo.com",
"attachments" : [],
}
_bug3 = {
"id" : 76,
+ "title" : "The third bug",
"assigned_to_email" : _unassigned_email,
"attachments" : [],
}
@@ -118,6 +121,9 @@ class MockBugzilla(Mock):
def bug_url_for_bug_id(self, bug_id):
return "%s/%s" % (self.bug_server_url, bug_id)
+ def fetch_bug_dictionary(self, bug_id):
+ return self.bug_cache.get(bug_id)
+
def attachment_url_for_id(self, attachment_id, action):
action_param = ""
if action and action != "view":
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list