Title: [90840] trunk/Tools
Revision
90840
Author
[email protected]
Date
2011-07-12 12:20:56 -0700 (Tue, 12 Jul 2011)

Log Message

sheriffbot can't perform rollouts
https://bugs.webkit.org/show_bug.cgi?id=64370

Reviewed by Eric Seidel.

Now that we're not updating the working copy before processing every
IRC message, the rollout command needs to update it manually.

* Scripts/webkitpy/tool/bot/irc_command.py:
* Scripts/webkitpy/tool/bot/irc_command_unittest.py:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (90839 => 90840)


--- trunk/Tools/ChangeLog	2011-07-12 19:16:53 UTC (rev 90839)
+++ trunk/Tools/ChangeLog	2011-07-12 19:20:56 UTC (rev 90840)
@@ -1,5 +1,18 @@
 2011-07-12  Adam Barth  <[email protected]>
 
+        sheriffbot can't perform rollouts
+        https://bugs.webkit.org/show_bug.cgi?id=64370
+
+        Reviewed by Eric Seidel.
+
+        Now that we're not updating the working copy before processing every
+        IRC message, the rollout command needs to update it manually.
+
+        * Scripts/webkitpy/tool/bot/irc_command.py:
+        * Scripts/webkitpy/tool/bot/irc_command_unittest.py:
+
+2011-07-12  Adam Barth  <[email protected]>
+
         Fix the grammar in the FIXME comment.
 
         * Scripts/webkitpy/common/net/resultsjsonparser.py:

Modified: trunk/Tools/Scripts/webkitpy/tool/bot/irc_command.py (90839 => 90840)


--- trunk/Tools/Scripts/webkitpy/tool/bot/irc_command.py	2011-07-12 19:16:53 UTC (rev 90839)
+++ trunk/Tools/Scripts/webkitpy/tool/bot/irc_command.py	2011-07-12 19:20:56 UTC (rev 90840)
@@ -100,6 +100,10 @@
         target_nicks = [requester_nick] + self._responsible_nicknames_from_revisions(tool, sheriff, svn_revision_list)
         return ", ".join(target_nicks)
 
+    def _update_working_copy(self, tool):
+        tool.scm().ensure_clean_working_directory(force_clean=True)
+        tool.executive.run_and_throw_if_fail(tool.port().update_webkit_command(), quiet=True)
+
     def execute(self, nick, args, tool, sheriff):
         svn_revision_list, rollout_reason = self._parse_args(args)
 
@@ -107,6 +111,8 @@
             # return is equivalent to an irc().post(), but makes for easier unit testing.
             return "%s: Usage: SVN_REVISION [SVN_REVISIONS] REASON" % nick
 
+        self._update_working_copy(tool)
+
         # FIXME: IRCCommand should bind to a tool and have a self._tool like Command objects do.
         # Likewise we should probably have a self._sheriff.
         nicks_string = self._nicks_string(tool, sheriff, nick, svn_revision_list)

Modified: trunk/Tools/Scripts/webkitpy/tool/bot/irc_command_unittest.py (90839 => 90840)


--- trunk/Tools/Scripts/webkitpy/tool/bot/irc_command_unittest.py	2011-07-12 19:16:53 UTC (rev 90839)
+++ trunk/Tools/Scripts/webkitpy/tool/bot/irc_command_unittest.py	2011-07-12 19:20:56 UTC (rev 90840)
@@ -30,7 +30,7 @@
 
 from webkitpy.common.system.outputcapture import OutputCapture
 from webkitpy.tool.bot.irc_command import *
-from webkitpy.tool.mocktool import MockTool
+from webkitpy.tool.mocktool import MockTool, MockExecutive
 
 
 class IRCCommandTest(unittest.TestCase):
@@ -76,6 +76,13 @@
         self.assertEquals(None, roll._parse_args([]))
         self.assertEquals("1234", roll._parse_args(["1234"]))
 
+    def test_rollout_updates_working_copy(self):
+        rollout = Rollout()
+        tool = MockTool()
+        tool.executive = MockExecutive(should_log=True)
+        expected_stderr = "MOCK run_and_throw_if_fail: ['mock-update-webkit']\n"
+        OutputCapture().assert_outputs(self, rollout._update_working_copy, [tool], expected_stderr=expected_stderr)
+
     def test_rollout(self):
         rollout = Rollout()
         self.assertEquals(([1234], "testing foo"),
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to