Changeset 73951 in webkit
- Timestamp:
- Dec 13, 2010 12:41:03 PM (13 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r73950 r73951 1 2010-12-13 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu> 2 3 Reviewed by Eric Seidel. 4 5 webkit-patch rollout should be able to do multi-revision rollouts 6 https://bugs.webkit.org/show_bug.cgi?id=33336 7 8 Make it possible to pass more than one revision to webkit-patch. 9 10 * Scripts/webkitpy/common/checkout/api.py: 11 * Scripts/webkitpy/common/checkout/changelog.py: 12 * Scripts/webkitpy/common/checkout/changelog_unittest.py: 13 * Scripts/webkitpy/tool/commands/abstractsequencedcommand.py: 14 * Scripts/webkitpy/tool/commands/download.py: 15 * Scripts/webkitpy/tool/commands/download_unittest.py: 16 * Scripts/webkitpy/tool/mocktool.py: 17 * Scripts/webkitpy/tool/steps/preparechangelogforrevert.py: 18 * Scripts/webkitpy/tool/steps/revertrevision.py: 19 1 20 2010-12-13 Eric Seidel <eric@webkit.org> 2 21 -
trunk/WebKitTools/Scripts/webkitpy/common/checkout/api.py
r73691 r73951 159 159 if len(conflicts): 160 160 raise ScriptError(message="Failed to apply reverse diff for revision %s because of the following conflicts:\n%s" % (revision, "\n".join(conflicts))) 161 162 def apply_reverse_diffs(self, revision_list): 163 for revision in sorted(revision_list, reverse=True): 164 self.apply_reverse_diff(revision) -
trunk/WebKitTools/Scripts/webkitpy/common/checkout/changelog.py
r73691 r73951 39 39 from webkitpy.common.config import urls 40 40 from webkitpy.common.net.bugzilla import parse_bug_id 41 from webkitpy.tool.grammar import join_with_separators 41 42 42 43 … … 146 147 147 148 # This probably does not belong in changelogs.py 148 def _message_for_revert(self, revision, reason, bug_url): 149 message = "Unreviewed, rolling out r%s.\n" % revision 150 message += "%s\n" % urls.view_revision_url(revision) 149 def _message_for_revert(self, revision_list, reason, bug_url): 150 message = "Unreviewed, rolling out %s.\n" % join_with_separators(['r' + str(revision) for revision in revision_list]) 151 for revision in revision_list: 152 message += "%s\n" % urls.view_revision_url(revision) 151 153 if bug_url: 152 154 message += "%s\n" % bug_url … … 157 159 return self._wrap_lines(message) 158 160 159 def update_for_revert(self, revision , reason, bug_url=None):161 def update_for_revert(self, revision_list, reason, bug_url=None): 160 162 reviewed_by_regexp = re.compile( 161 163 "%sReviewed by NOBODY \(OOPS!\)\." % self._changelog_indent) … … 164 166 for line in fileinput.FileInput(self.path, inplace=1): 165 167 if reviewed_by_regexp.search(line): 166 message_lines = self._message_for_revert(revision ,168 message_lines = self._message_for_revert(revision_list, 167 169 reason, 168 170 bug_url) -
trunk/WebKitTools/Scripts/webkitpy/common/checkout/changelog_unittest.py
r61098 r73951 158 158 changelog = ChangeLog("/fake/path") 159 159 long_reason = "This is a very long reason which should be long enough so that _message_for_revert will need to wrap it. We'll also include a https://veryveryveryveryverylongbugurl.com/reallylongbugthingy.cgi?bug_id=12354 link so that we can make sure we wrap that right too." 160 message = changelog._message_for_revert( 12345, long_reason, "http://example.com/123")160 message = changelog._message_for_revert([12345], long_reason, "http://example.com/123") 161 161 self.assertEquals(message, self._revert_message) 162 162 … … 176 176 Unreviewed, rolling out r12345. 177 177 http://trac.webkit.org/changeset/12345 178 179 Reason 180 181 * Scripts/bugzilla-tool: 182 ''' 183 184 _multiple_revert_entry_with_bug_url = '''2009-08-19 Eric Seidel <eric@webkit.org> 185 186 Unreviewed, rolling out r12345, r12346, and r12347. 187 http://trac.webkit.org/changeset/12345 188 http://trac.webkit.org/changeset/12346 189 http://trac.webkit.org/changeset/12347 190 http://example.com/123 191 192 Reason 193 194 * Scripts/bugzilla-tool: 195 ''' 196 197 _multiple_revert_entry_without_bug_url = '''2009-08-19 Eric Seidel <eric@webkit.org> 198 199 Unreviewed, rolling out r12345, r12346, and r12347. 200 http://trac.webkit.org/changeset/12345 201 http://trac.webkit.org/changeset/12346 202 http://trac.webkit.org/changeset/12347 178 203 179 204 Reason … … 196 221 197 222 def test_update_for_revert(self): 198 self._assert_update_for_revert_output([12345, "Reason"], self._revert_entry_without_bug_url) 199 self._assert_update_for_revert_output([12345, "Reason", "http://example.com/123"], self._revert_entry_with_bug_url) 223 self._assert_update_for_revert_output([[12345], "Reason"], self._revert_entry_without_bug_url) 224 self._assert_update_for_revert_output([[12345], "Reason", "http://example.com/123"], self._revert_entry_with_bug_url) 225 self._assert_update_for_revert_output([[12345, 12346, 12347], "Reason"], self._multiple_revert_entry_without_bug_url) 226 self._assert_update_for_revert_output([[12345, 12346, 12347], "Reason", "http://example.com/123"], self._multiple_revert_entry_with_bug_url) 200 227 201 228 -
trunk/WebKitTools/Scripts/webkitpy/tool/commands/abstractsequencedcommand.py
r56512 r73951 27 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 29 from webkitpy.common.system.executive import ScriptError 30 from webkitpy.common.system.deprecated_logging import log 29 31 from webkitpy.tool.commands.stepsequence import StepSequence 30 32 from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand … … 41 43 42 44 def execute(self, options, args, tool): 43 self._sequence.run_and_handle_errors(tool, options, self._prepare_state(options, args, tool)) 45 try: 46 state = self._prepare_state(options, args, tool) 47 except ScriptError, e: 48 log(e.message_with_output()) 49 exit(e.exit_code or 2) 50 51 self._sequence.run_and_handle_errors(tool, options, state) -
trunk/WebKitTools/Scripts/webkitpy/tool/commands/download.py
r73691 r73951 290 290 291 291 class AbstractRolloutPrepCommand(AbstractSequencedCommand): 292 argument_names = "REVISION REASON"292 argument_names = "REVISION [REVISIONS] REASON" 293 293 294 294 def _commit_info(self, revision): … … 305 305 306 306 def _prepare_state(self, options, args, tool): 307 revision = args[0] 308 commit_info = self._commit_info(revision) 307 revision_list = [] 308 for revision in str(args[0]).split(): 309 if revision.isdigit(): 310 revision_list.append(int(revision)) 311 else: 312 raise ScriptError(message="Invalid svn revision number: " + revision) 313 revision_list.sort() 314 315 # We use the earliest revision for the bug info 316 earliest_revision = revision_list[0] 317 commit_info = self._commit_info(earliest_revision) 309 318 cc_list = sorted([party.bugzilla_email() 310 319 for party in commit_info.responsible_parties() 311 320 if party.bugzilla_email()]) 312 321 return { 313 "revision": revision, 322 "revision": earliest_revision, 323 "revision_list": revision_list, 314 324 "bug_id": commit_info.bug_id(), 315 325 # FIXME: We should used the list as the canonical representation. … … 321 331 class PrepareRollout(AbstractRolloutPrepCommand): 322 332 name = "prepare-rollout" 323 help_text = "Revert the given revision in the working copy and prepare ChangeLogs with revert reason"333 help_text = "Revert the given revision(s) in the working copy and prepare ChangeLogs with revert reason" 324 334 long_help = """Updates the working copy. 325 Applies the inverse diff for the provided revision .335 Applies the inverse diff for the provided revision(s). 326 336 Creates an appropriate rollout ChangeLog, including a trac link and bug link. 327 337 """ … … 336 346 class CreateRollout(AbstractRolloutPrepCommand): 337 347 name = "create-rollout" 338 help_text = "Creates a bug to track a broken SVN revisionand uploads a rollout patch."348 help_text = "Creates a bug to track the broken SVN revision(s) and uploads a rollout patch." 339 349 steps = [ 340 350 steps.CleanWorkingDirectory, … … 376 386 name = "rollout" 377 387 show_in_main_help = True 378 help_text = "Revert the given revision in the working copy and optionally commit the revert and re-open the original bug"388 help_text = "Revert the given revision(s) in the working copy and optionally commit the revert and re-open the original bug" 379 389 long_help = """Updates the working copy. 380 390 Applies the inverse diff for the provided revision. -
trunk/WebKitTools/Scripts/webkitpy/tool/commands/download_unittest.py
r73827 r73951 33 33 from webkitpy.tool.commands.commandtest import CommandsTest 34 34 from webkitpy.tool.commands.download import * 35 from webkitpy.tool.mocktool import Mock Options, MockTool35 from webkitpy.tool.mocktool import MockCheckout, MockOptions, MockTool 36 36 37 37 … … 53 53 commit_info = output.assert_outputs(self, command._commit_info, [1234], expected_stderr=expected_stderr) 54 54 self.assertEqual(commit_info, mock_commit_info) 55 56 def test_prepare_state(self): 57 command = AbstractRolloutPrepCommand() 58 mock_commit_info = MockCheckout().commit_info_for_revision(123) 59 command._commit_info = lambda revision: mock_commit_info 60 61 state = command._prepare_state(None, ["124 123 125", "Reason"], None) 62 self.assertEqual(123, state["revision"]) 63 self.assertEqual([123, 124, 125], state["revision_list"]) 64 65 self.assertRaises(ScriptError, command._prepare_state, options=None, args=["125 r122 123", "Reason"], tool=None) 66 self.assertRaises(ScriptError, command._prepare_state, options=None, args=["125 foo 123", "Reason"], tool=None) 55 67 56 68 … … 186 198 """ 187 199 self.assert_execute_outputs(CreateRollout(), [852, "Reason"], options=self._default_options(), expected_stderr=expected_stderr) 200 self.assert_execute_outputs(CreateRollout(), ["855 852 854", "Reason"], options=self._default_options(), expected_stderr=expected_stderr) 188 201 189 202 def test_rollout(self): -
trunk/WebKitTools/Scripts/webkitpy/tool/mocktool.py
r73827 r73951 509 509 pass 510 510 511 def apply_reverse_diff (self, revision):511 def apply_reverse_diffs(self, revision): 512 512 pass 513 513 -
trunk/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelogforrevert.py
r63004 r73951 42 42 # FIXME: Seems we should prepare the message outside of changelogs.py and then just pass in 43 43 # text that we want to use to replace the reviewed by line. 44 ChangeLog(changelog_path).update_for_revert(state["revision "], state["reason"], bug_url)44 ChangeLog(changelog_path).update_for_revert(state["revision_list"], state["reason"], bug_url) -
trunk/WebKitTools/Scripts/webkitpy/tool/steps/revertrevision.py
r70547 r73951 32 32 class RevertRevision(AbstractStep): 33 33 def run(self, state): 34 self._tool.checkout().apply_reverse_diff (state["revision"])34 self._tool.checkout().apply_reverse_diffs(state["revision_list"]) 35 35 self.did_modify_checkout(state)
Note: See TracChangeset
for help on using the changeset viewer.