2009-11-20 Adam Barth <abarth@webkit.org>
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Nov 2009 22:51:56 +0000 (22:51 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Nov 2009 22:51:56 +0000 (22:51 +0000)
        Reviewed by Eric Seidel.

        Move prepare_clean_working_directory into the LandingSequence
        https://bugs.webkit.org/show_bug.cgi?id=31743

        * Scripts/bugzilla-tool:
        * Scripts/modules/landingsequence.py:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@51259 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitTools/ChangeLog
WebKitTools/Scripts/bugzilla-tool
WebKitTools/Scripts/modules/landingsequence.py

index bd569da15a078f3635ac7b601b17d7b9e0450c02..ef2c0b426237a96a7ab6262a4543e729b8822696 100644 (file)
@@ -1,3 +1,13 @@
+2009-11-20  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Move prepare_clean_working_directory into the LandingSequence
+        https://bugs.webkit.org/show_bug.cgi?id=31743
+
+        * Scripts/bugzilla-tool:
+        * Scripts/modules/landingsequence.py:
+
 2009-11-20  Yael Aharon  <yael.aharon@nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
index 030f65bf3c78ba312946ec2df4523e9d629c70ce..a27b07c5f297d3e6357dab482dbc95773c756179 100755 (executable)
@@ -190,28 +190,25 @@ class LandDiffSequence(ConditionalLandingSequence):
     def __init__(self, patch, options, tool):
         ConditionalLandingSequence.__init__(self, patch, options, tool)
 
-    def update(self):
-        pass
-
-    def apply_patch(self):
-        pass
-
-    def close_patch(self, commit_log):
-        self._comment_test = bug_comment_from_commit_text(self._tool.scm(), commit_log)
-        # There is no patch to close.
+    def run(self):
+        self.build()
+        self.test()
+        commit_log = self.commit()
+        self.close_bug(commit_log)
 
-    def close_bug(self):
+    def close_bug(self, commit_log):
+        comment_test = bug_comment_from_commit_text(self._tool.scm(), commit_log)
         bug_id = self._patch["bug_id"]
         if bug_id:
             log("Updating bug %s" % bug_id)
             if self._options.close_bug:
-                self._tool.bugs.close_bug_as_fixed(bug_id, self._comment_test)
+                self._tool.bugs.close_bug_as_fixed(bug_id, comment_test)
             else:
                 # FIXME: We should a smart way to figure out if the patch is attached
                 # to the bug, and if so obsolete it.
-                self._tool.bugs.post_comment_to_bug(bug_id, self._comment_test)
+                self._tool.bugs.post_comment_to_bug(bug_id, comment_test)
         else:
-            log(self._comment_test)
+            log(comment_test)
             log("No bug id provided.")
 
 
@@ -304,6 +301,7 @@ class BuildAttachmentSequence(LandingSequence):
         LandingSequence.__init__(self, patch, options, tool)
 
     def run(self):
+        self.clean()
         self.update()
         self.apply_patch()
         self.build()
@@ -322,7 +320,6 @@ class BuildAttachment(AbstractPatchProcessingCommand):
     def _prepare_to_process(self, options, args, tool):
         # Check the tree status first so we can fail early.
         WebKitLandingScripts.ensure_builders_are_green(tool.buildbot, options)
-        WebKitLandingScripts.prepare_clean_working_directory(tool.scm(), options)
 
     def _process_patch(self, patch, options, args, tool):
         sequence = BuildAttachmentSequence(patch, options, tool)
@@ -339,12 +336,12 @@ class AbstractPatchLandingCommand(AbstractPatchProcessingCommand):
     def _prepare_to_process(self, options, args, tool):
         # Check the tree status first so we can fail early.
         WebKitLandingScripts.ensure_builders_are_green(tool.buildbot, options)
-        WebKitLandingScripts.prepare_clean_working_directory(tool.scm(), options)
 
     def _process_patch(self, patch, options, args, tool):
         sequence = ConditionalLandingSequence(patch, options, tool)
         sequence.run_and_handle_errors()
 
+
 class LandAttachment(AbstractPatchLandingCommand):
     name = "land-attachment"
     def __init__(self):
index 55f6d96d996e5ce97660f708c315b7fe4dde4467..4dabcbc3fe8c94d0de9710132c46e68df9516543 100644 (file)
@@ -43,6 +43,7 @@ class LandingSequence:
         self._port = WebKitPort.port(self._options)
 
     def run(self):
+        self.clean()
         self.update()
         self.apply_patch()
         self.build()
@@ -66,6 +67,9 @@ class LandingSequence:
                 self._tool.bugs.reject_patch_from_commit_queue(self._patch["id"], e.message_with_output())
             WorkQueue.exit_after_handled_error(e)
 
+    def clean(self):
+        WebKitLandingScripts.prepare_clean_working_directory(self._tool.scm(), self._options)
+
     def update(self):
         self._tool.scm().update_webkit()