Changeset 53079 in webkit
- Timestamp:
- Jan 11, 2010 8:50:07 AM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 1 added
- 5 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r53076 r53079 1 2010-01-10 Adam Barth <abarth@webkit.org> 2 3 Reviewed by David Kilzer. 4 5 bugzilla-tool submit-patch mistakenly picks up bug URLs in non-ChangeLog files 6 https://bugs.webkit.org/show_bug.cgi?id=33197 7 8 We should just search for bug numbers in the ChangeLogs instead of in 9 the whole diff. 10 11 * Scripts/test-webkitpy: 12 * Scripts/webkitpy/commands/abstractdiffcommand.py: Added. 13 * Scripts/webkitpy/commands/abstractdiffcommand_unittest.py: Added. 14 * Scripts/webkitpy/commands/download.py: 15 * Scripts/webkitpy/commands/upload.py: 16 * Scripts/webkitpy/mock_bugzillatool.py: 17 1 18 2010-01-11 Chris Jerdonek <chris.jerdonek@gmail.com> 2 19 -
trunk/WebKitTools/Scripts/test-webkitpy
r53043 r53079 34 34 from webkitpy.buildbot_unittest import * 35 35 from webkitpy.changelogs_unittest import * 36 from webkitpy.commands.abstractdiffcommand_unittest import * 36 37 from webkitpy.commands.download_unittest import * 37 38 from webkitpy.commands.early_warning_system_unittest import * -
trunk/WebKitTools/Scripts/webkitpy/commands/abstractdiffcommand.py
- Property svn:executable deleted
r53078 r53079 1 #!/usr/bin/env python 2 # Copyright (c) 2009 Google Inc. All rights reserved. 1 # Copyright (C) 2010 Google Inc. All rights reserved. 3 2 # 4 3 # Redistribution and use in source and binary forms, with or without … … 28 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 28 30 import sys 31 import unittest 29 from webkitpy.bugzilla import parse_bug_id 30 from webkitpy.commands.abstractsequencedcommand import AbstractSequencedCommand 32 31 33 from webkitpy.bugzilla_unittest import *34 from webkitpy.buildbot_unittest import *35 from webkitpy.changelogs_unittest import *36 from webkitpy.commands.download_unittest import *37 from webkitpy.commands.early_warning_system_unittest import *38 from webkitpy.commands.upload_unittest import *39 from webkitpy.commands.queries_unittest import *40 from webkitpy.commands.queues_unittest import *41 from webkitpy.committers_unittest import *42 from webkitpy.credentials_unittest import *43 from webkitpy.diff_parser_unittest import *44 from webkitpy.executive_unittest import *45 from webkitpy.multicommandtool_unittest import *46 from webkitpy.networktransaction_unittest import *47 from webkitpy.queueengine_unittest import *48 from webkitpy.steps.steps_unittest import *49 from webkitpy.steps.updatechangelogswithreview_unittests import *50 from webkitpy.style.unittests import * # for check-webkit-style51 from webkitpy.webkit_logging_unittest import *52 from webkitpy.webkitport_unittest import *53 32 54 if __name__ == "__main__": 55 # FIXME: This is a hack, but I'm tired of commenting out the test. 56 # See https://bugs.webkit.org/show_bug.cgi?id=31818 57 if len(sys.argv) > 1 and sys.argv[1] == "--all": 58 sys.argv.remove("--all") 59 from webkitpy.scm_unittest import * 60 61 unittest.main() 33 class AbstractDiffCommand(AbstractSequencedCommand): 34 def _bug_id(self, args, tool): 35 # Perfer a bug id passed as an argument over a bug URL in the ChangeLogs. 36 bug_id = args and args[0] 37 if not bug_id: 38 bug_id = parse_bug_id(tool.scm().commit_message_for_this_commit().message()) 39 return bug_id -
trunk/WebKitTools/Scripts/webkitpy/commands/download.py
r53066 r53079 37 37 # We could instead use from modules import buildsteps and then prefix every buildstep with "buildsteps." 38 38 from webkitpy.changelogs import ChangeLog 39 from webkitpy.commands.abstractdiffcommand import AbstractDiffCommand 39 40 from webkitpy.commands.abstractsequencedcommand import AbstractSequencedCommand 40 41 from webkitpy.comments import bug_comment_from_commit_text … … 67 68 68 69 69 class Land(Abstract SequencedCommand):70 class Land(AbstractDiffCommand): 70 71 name = "land" 71 72 help_text = "Land the current working directory diff and updates the associated bug if any" … … 89 90 "patch" : { 90 91 "id" : None, 91 "bug_id" : (args and args[0]) or parse_bug_id(tool.scm().create_patch()),92 "bug_id" : self._bug_id(args, tool), 92 93 } 93 94 } … … 269 270 def _parse_bug_id_from_revision_diff(tool, revision): 270 271 original_diff = tool.scm().diff_for_revision(revision) 272 # FIXME: This is wrong because it picks up bug numbers outside of ChangeLogs 271 273 return parse_bug_id(original_diff) 272 274 -
trunk/WebKitTools/Scripts/webkitpy/commands/upload.py
r53066 r53079 39 39 40 40 from webkitpy.bugzilla import parse_bug_id 41 from webkitpy.commands.abstractdiffcommand import AbstractDiffCommand 41 42 from webkitpy.commands.abstractsequencedcommand import AbstractSequencedCommand 42 43 from webkitpy.comments import bug_comment_from_svn_revision … … 100 101 101 102 102 class AbstractPatchUploadingCommand(AbstractSequencedCommand): 103 def _bug_id(self, args, tool, state): 104 # Perfer a bug id passed as an argument over a bug url in the diff (i.e. ChangeLogs). 105 bug_id = args and args[0] 106 if not bug_id: 107 state["diff"] = tool.scm().create_patch() 108 bug_id = parse_bug_id(state["diff"]) 109 return bug_id 110 111 112 class Post(AbstractPatchUploadingCommand): 103 class Post(AbstractDiffCommand): 113 104 name = "post" 114 105 help_text = "Attach the current working directory diff to a bug as a patch file" … … 123 114 124 115 def _prepare_state(self, options, args, tool): 125 state = {} 126 state["bug_id"] = self._bug_id(args, tool, state) 116 state = { "bug_id" : self._bug_id(args, tool) } 127 117 if not state["bug_id"]: 128 118 error("No bug id passed and no bug url found in diff, can't post.") … … 146 136 147 137 148 class Upload(Abstract PatchUploadingCommand):138 class Upload(AbstractDiffCommand): 149 139 name = "upload" 150 140 help_text = "Automates the process of uploading a patch for review" … … 170 160 171 161 def _prepare_state(self, options, args, tool): 172 state = {} 173 state["bug_id"] = self._bug_id(args, tool, state) 162 state = { "bug_id" : self._bug_id(args, tool) } 174 163 return state 175 164 -
trunk/WebKitTools/Scripts/webkitpy/mock_bugzillatool.py
r52724 r53079 157 157 return ["Commitish1", "Commitish2"] 158 158 159 def commit_message_for_this_commit(self): 160 return CommitMessage(["CommitMessage1", "https://bugs.webkit.org/show_bug.cgi?id=93"]) 161 159 162 def commit_message_for_local_commit(self, commit_id): 160 163 if commit_id == "Commitish1": 161 return CommitMessage( "CommitMessage1\nhttps://bugs.example.org/show_bug.cgi?id=42\n")164 return CommitMessage(["CommitMessage1", "https://bugs.webkit.org/show_bug.cgi?id=42"]) 162 165 if commit_id == "Commitish2": 163 return CommitMessage( "CommitMessage2\nhttps://bugs.example.org/show_bug.cgi?id=75\n")166 return CommitMessage(["CommitMessage2", "https://bugs.webkit.org/show_bug.cgi?id=75"]) 164 167 raise Exception("Bogus commit_id in commit_message_for_local_commit.") 165 168
Note: See TracChangeset
for help on using the changeset viewer.