Title: [104998] trunk/Tools
Revision
104998
Author
aba...@webkit.org
Date
2012-01-13 15:28:17 -0800 (Fri, 13 Jan 2012)

Log Message

Remove --dry-run support from webkit-patch
https://bugs.webkit.org/show_bug.cgi?id=76300

Reviewed by Dirk Pranke.

We don't use this functionality for anything, and it doesn't really
work.  Someone in #webkit tried using it and and got sad/confused.  We
should just remove it.

* Scripts/webkitpy/common/checkout/scm/git.py:
(Git.push_local_commits_to_server):
* Scripts/webkitpy/common/checkout/scm/scm.py:
(SCM.__init__):
* Scripts/webkitpy/common/checkout/scm/scm_unittest.py:
(_shared_test_commit_with_message):
(GitSVNTest.test_commit_text_parsing):
* Scripts/webkitpy/common/checkout/scm/svn.py:
(SVN.commit_with_message):
* Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
(Bugzilla.__init__):
(Bugzilla.quips):
(Bugzilla.authenticate):
(Bugzilla.add_attachment_to_bug):
(Bugzilla.add_patch_to_bug):
(Bugzilla.create_bug):
(Bugzilla.clear_attachment_flags):
(Bugzilla.set_flag_on_attachment):
(Bugzilla.obsolete_attachment):
(Bugzilla.add_cc_to_bug):
(Bugzilla.post_comment_to_bug):
(Bugzilla.close_bug_as_fixed):
(Bugzilla.reassign_bug):
(reopen_bug):
* Scripts/webkitpy/test/main.py:
(Tester.parse_args):
(Tester.run_tests):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (104997 => 104998)


--- trunk/Tools/ChangeLog	2012-01-13 23:16:01 UTC (rev 104997)
+++ trunk/Tools/ChangeLog	2012-01-13 23:28:17 UTC (rev 104998)
@@ -1,3 +1,42 @@
+2012-01-13  Adam Barth  <aba...@webkit.org>
+
+        Remove --dry-run support from webkit-patch
+        https://bugs.webkit.org/show_bug.cgi?id=76300
+
+        Reviewed by Dirk Pranke.
+
+        We don't use this functionality for anything, and it doesn't really
+        work.  Someone in #webkit tried using it and and got sad/confused.  We
+        should just remove it.
+
+        * Scripts/webkitpy/common/checkout/scm/git.py:
+        (Git.push_local_commits_to_server):
+        * Scripts/webkitpy/common/checkout/scm/scm.py:
+        (SCM.__init__):
+        * Scripts/webkitpy/common/checkout/scm/scm_unittest.py:
+        (_shared_test_commit_with_message):
+        (GitSVNTest.test_commit_text_parsing):
+        * Scripts/webkitpy/common/checkout/scm/svn.py:
+        (SVN.commit_with_message):
+        * Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
+        (Bugzilla.__init__):
+        (Bugzilla.quips):
+        (Bugzilla.authenticate):
+        (Bugzilla.add_attachment_to_bug):
+        (Bugzilla.add_patch_to_bug):
+        (Bugzilla.create_bug):
+        (Bugzilla.clear_attachment_flags):
+        (Bugzilla.set_flag_on_attachment):
+        (Bugzilla.obsolete_attachment):
+        (Bugzilla.add_cc_to_bug):
+        (Bugzilla.post_comment_to_bug):
+        (Bugzilla.close_bug_as_fixed):
+        (Bugzilla.reassign_bug):
+        (reopen_bug):
+        * Scripts/webkitpy/test/main.py:
+        (Tester.parse_args):
+        (Tester.run_tests):
+
 2012-01-13  David Levin  <le...@chromium.org>
 
         check-webkit-style: should encourage the use of Own* classes for Windows DC.

Modified: trunk/Tools/Scripts/webkitpy/common/checkout/scm/git.py (104997 => 104998)


--- trunk/Tools/Scripts/webkitpy/common/checkout/scm/git.py	2012-01-13 23:16:01 UTC (rev 104997)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/scm/git.py	2012-01-13 23:28:17 UTC (rev 104998)
@@ -434,16 +434,11 @@
 
     def push_local_commits_to_server(self, username=None, password=None):
         dcommit_command = ['git', 'svn', 'dcommit']
-        if self.dryrun:
-            dcommit_command.append('--dry-run')
         if (not username or not password) and not self.has_authorization_for_realm(SVN.svn_server_realm):
             raise AuthenticationError(SVN.svn_server_host, prompt_for_password=True)
         if username:
             dcommit_command.extend(["--username", username])
         output = self.run(dcommit_command, error_handler=commit_error_handler, input=password, cwd=self.checkout_root)
-        # Return a string which looks like a commit so that things which parse this output will succeed.
-        if self.dryrun:
-            output += "\nCommitted r0"
         return output
 
     # This function supports the following argument formats:

Modified: trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm.py (104997 => 104998)


--- trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm.py	2012-01-13 23:16:01 UTC (rev 104997)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm.py	2012-01-13 23:28:17 UTC (rev 104998)
@@ -61,7 +61,6 @@
     def __init__(self, cwd, executive=None, filesystem=None):
         self.cwd = cwd
         self.checkout_root = self.find_checkout_root(self.cwd)
-        self.dryrun = False
         self._executive = executive or Executive()
         self._filesystem = filesystem or FileSystem()
 

Modified: trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py (104997 => 104998)


--- trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py	2012-01-13 23:16:01 UTC (rev 104997)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py	2012-01-13 23:28:17 UTC (rev 104998)
@@ -757,11 +757,6 @@
         commit_text = self.scm.commit_with_message("another test commit", username)
         self.assertEqual(self.scm.svn_revision_from_commit_text(commit_text), '6')
 
-        self.scm.dryrun = True
-        write_into_file_at_path('test_file', 'still more test content')
-        commit_text = self.scm.commit_with_message("yet another test commit", username)
-        self.assertEqual(self.scm.svn_revision_from_commit_text(commit_text), '0')
-
     def test_commit_in_subdir(self, username=None):
         write_into_file_at_path('test_dir/test_file3', 'more test content')
         os.chdir("test_dir")
@@ -1216,11 +1211,6 @@
         commit_text = self.scm.commit_with_message("another test commit")
         self.assertEqual(self.scm.svn_revision_from_commit_text(commit_text), '6')
 
-        self.scm.dryrun = True
-        write_into_file_at_path('test_file', 'still more test content')
-        commit_text = self.scm.commit_with_message("yet another test commit")
-        self.assertEqual(self.scm.svn_revision_from_commit_text(commit_text), '0')
-
     def test_commit_with_message_working_copy_only(self):
         write_into_file_at_path('test_file_commit1', 'more test content')
         run_command(['git', 'add', 'test_file_commit1'])

Modified: trunk/Tools/Scripts/webkitpy/common/checkout/scm/svn.py (104997 => 104998)


--- trunk/Tools/Scripts/webkitpy/common/checkout/scm/svn.py	2012-01-13 23:16:01 UTC (rev 104997)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/scm/svn.py	2012-01-13 23:28:17 UTC (rev 104998)
@@ -333,12 +333,6 @@
         if changed_files:
             svn_commit_args.extend(changed_files)
 
-        if self.dryrun:
-            _log.debug('Would run SVN command: "' + " ".join(svn_commit_args) + '"')
-
-            # Return a string which looks like a commit so that things which parse this output will succeed.
-            return "Dry run, no commit.\nCommitted revision 0."
-
         return self._run_svn(svn_commit_args, cwd=self.checkout_root, error_handler=commit_error_handler)
 
     def svn_commit_log(self, svn_revision):

Modified: trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py (104997 => 104998)


--- trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py	2012-01-13 23:16:01 UTC (rev 104997)
+++ trunk/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py	2012-01-13 23:28:17 UTC (rev 104998)
@@ -259,16 +259,13 @@
 
 
 class Bugzilla(object):
-    def __init__(self, dryrun=False, committers=committers.CommitterList()):
-        self.dryrun = dryrun
+    def __init__(self, committers=committers.CommitterList()):
         self.authenticated = False
         self.queries = BugzillaQueries(self)
         self.committers = committers
         self.cached_quips = []
         self.edit_user_parser = EditUsersParser()
 
-        # FIXME: We should use some sort of Browser mock object when in dryrun
-        # mode (to prevent any mistakes).
         from webkitpy.thirdparty.autoinstalled.mechanize import Browser
         self.browser = Browser()
         # Ignore bugs.webkit.org/robots.txt until we fix it to allow this script.
@@ -291,7 +288,7 @@
     def quips(self):
         # We only fetch and parse the list of quips once per instantiation
         # so that we do not burden bugs.webkit.org.
-        if not self.cached_quips and not self.dryrun:
+        if not self.cached_quips:
             self.cached_quips = self.queries.fetch_quips()
         return self.cached_quips
 
@@ -475,11 +472,6 @@
         if self.authenticated:
             return
 
-        if self.dryrun:
-            log("Skipping log in for dry run...")
-            self.authenticated = True
-            return
-
         credentials = Credentials(config_urls.bug_server_host, git_prefix="bugzilla")
 
         attempts = 0
@@ -563,10 +555,6 @@
                               comment_text=None):
         self.authenticate()
         log('Adding attachment "%s" to %s' % (description, self.bug_url_for_bug_id(bug_id)))
-        if self.dryrun:
-            log(comment_text)
-            return
-
         self.browser.open(self.add_attachment_url(bug_id))
         self.browser.select_form(name="entryform")
         file_object = self._file_object_for_upload(file_or_string)
@@ -590,10 +578,6 @@
         self.authenticate()
         log('Adding patch "%s" to %s' % (description, self.bug_url_for_bug_id(bug_id)))
 
-        if self.dryrun:
-            log(comment_text)
-            return
-
         self.browser.open(self.add_attachment_url(bug_id))
         self.browser.select_form(name="entryform")
         file_object = self._file_object_for_upload(file_or_string)
@@ -644,11 +628,6 @@
         self.authenticate()
 
         log('Creating bug with title "%s"' % bug_title)
-        if self.dryrun:
-            log(bug_description)
-            # FIXME: This will make some paths fail, as they assume this returns an id.
-            return
-
         self.browser.open(config_urls.bug_server_url + "enter_bug.cgi?product=WebKit")
         self.browser.select_form(name="Create")
         component_items = self.browser.find_control('component').items
@@ -706,9 +685,6 @@
             comment_text += "\n\n%s" % additional_comment_text
         log(comment_text)
 
-        if self.dryrun:
-            return
-
         self.browser.open(self.attachment_url_for_id(attachment_id, 'edit'))
         self.browser.select_form(nr=1)
         self.browser.set_value(comment_text, name='comment', nr=0)
@@ -732,9 +708,6 @@
             comment_text += "\n\n%s" % additional_comment_text
         log(comment_text)
 
-        if self.dryrun:
-            return
-
         self.browser.open(self.attachment_url_for_id(attachment_id, 'edit'))
         self.browser.select_form(nr=1)
 
@@ -751,10 +724,6 @@
         self.authenticate()
 
         log("Obsoleting attachment: %s" % attachment_id)
-        if self.dryrun:
-            log(comment_text)
-            return
-
         self.browser.open(self.attachment_url_for_id(attachment_id, 'edit'))
         self.browser.select_form(nr=1)
         self.browser.find_control('isobsolete').items[0].selected = True
@@ -772,9 +741,6 @@
         self.authenticate()
 
         log("Adding %s to the CC list for bug %s" % (email_address_list, bug_id))
-        if self.dryrun:
-            return
-
         self.browser.open(self.bug_url_for_bug_id(bug_id))
         self.browser.select_form(name="changeform")
         self.browser["newcc"] = ", ".join(email_address_list)
@@ -784,10 +750,6 @@
         self.authenticate()
 
         log("Adding comment to bug %s" % bug_id)
-        if self.dryrun:
-            log(comment_text)
-            return
-
         self.browser.open(self.bug_url_for_bug_id(bug_id))
         self.browser.select_form(name="changeform")
         self.browser["comment"] = comment_text
@@ -799,10 +761,6 @@
         self.authenticate()
 
         log("Closing bug %s as fixed" % bug_id)
-        if self.dryrun:
-            log(comment_text)
-            return
-
         self.browser.open(self.bug_url_for_bug_id(bug_id))
         self.browser.select_form(name="changeform")
         if comment_text:
@@ -821,10 +779,6 @@
             assignee = self.username
 
         log("Assigning bug %s to %s" % (bug_id, assignee))
-        if self.dryrun:
-            log(comment_text)
-            return
-
         self.browser.open(self.bug_url_for_bug_id(bug_id))
         self.browser.select_form(name="changeform")
 
@@ -850,9 +804,6 @@
         # Bugzilla requires a comment when re-opening a bug, so we know it will
         # never be None.
         log(comment_text)
-        if self.dryrun:
-            return
-
         self.browser.open(self.bug_url_for_bug_id(bug_id))
         self.browser.select_form(name="changeform")
         bug_status = self.browser.find_control("bug_status", type="select")

Modified: trunk/Tools/Scripts/webkitpy/tool/main.py (104997 => 104998)


--- trunk/Tools/Scripts/webkitpy/tool/main.py	2012-01-13 23:16:01 UTC (rev 104997)
+++ trunk/Tools/Scripts/webkitpy/tool/main.py	2012-01-13 23:28:17 UTC (rev 104998)
@@ -45,7 +45,6 @@
     global_options = [
         make_option("-v", "--verbose", action="" dest="verbose", default=False, help="enable all logging"),
         make_option("-d", "--directory", action="" dest="patch_directories", default=[], help="Directory to look at for changed files"),
-        make_option("--dry-run", action="" dest="dry_run", default=False, help="do not touch remote servers"),
         make_option("--status-host", action="" dest="status_host", type="string", help="Hostname (e.g. localhost or commit.webkit.org) where status updates should be posted."),
         make_option("--bot-id", action="" dest="bot_id", type="string", help="Identifier for this bot (if multiple bots are running for a queue)"),
         make_option("--irc-password", action="" dest="irc_password", type="string", help="Password to use when communicating via IRC."),
@@ -92,9 +91,6 @@
     # FIXME: This may be unnecessary since we pass global options to all commands during execute() as well.
     def handle_global_options(self, options):
         self._initialize_scm(options.patch_directories)
-        if options.dry_run:
-            self.scm().dryrun = True
-            self.bugs.dryrun = True
         if options.status_host:
             self.status_server.set_host(options.status_host)
         if options.bot_id:
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to