[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 00:53:20 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 8d7101702d4c0bdbac17305d000d006de935b855
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jan 4 11:37:24 2010 +0000

    2010-01-04  Eric Seidel  <eric at webkit.org>
    
            Reviewed by Adam Barth.
    
            Make bugzilla-tool rollout include a bug link in the ChangeLog entry
            https://bugs.webkit.org/show_bug.cgi?id=33146
    
            One more step towards better rollouts.
    
            * Scripts/webkitpy/changelogs.py:
            * Scripts/webkitpy/changelogs_unittest.py:
            * Scripts/webkitpy/steps/preparechangelogforrevert.py:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52728 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index d8695bb..7c9796b 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,16 @@
+2010-01-04  Eric Seidel  <eric at webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Make bugzilla-tool rollout include a bug link in the ChangeLog entry
+        https://bugs.webkit.org/show_bug.cgi?id=33146
+
+        One more step towards better rollouts.
+
+        * Scripts/webkitpy/changelogs.py:
+        * Scripts/webkitpy/changelogs_unittest.py:
+        * Scripts/webkitpy/steps/preparechangelogforrevert.py:
+
 2010-01-04  Adam Barth  <abarth at webkit.org>
 
         Reviewed by Eric Seidel.
diff --git a/WebKitTools/Scripts/webkitpy/changelogs.py b/WebKitTools/Scripts/webkitpy/changelogs.py
index a407d23..55287fe 100644
--- a/WebKitTools/Scripts/webkitpy/changelogs.py
+++ b/WebKitTools/Scripts/webkitpy/changelogs.py
@@ -69,14 +69,17 @@ class ChangeLog:
         finally:
             changelog_file.close()
 
-    def update_for_revert(self, revision):
+    def update_for_revert(self, revision, bug_url=None):
         reviewed_by_regexp = re.compile('Reviewed by NOBODY \(OOPS!\)\.')
         removing_boilerplate = False
         # inplace=1 creates a backup file and re-directs stdout to the file
         for line in fileinput.FileInput(self.path, inplace=1):
             if reviewed_by_regexp.search(line):
                 print reviewed_by_regexp.sub("No review, rolling out r%s." % revision, line),
-                print "        %s\n" % view_source_url(revision)
+                print "        %s" % view_source_url(revision)
+                if bug_url:
+                    print "        %s" % bug_url
+                print # Add an extra new line after the rollout message.
                 # Remove all the ChangeLog boilerplate between the Reviewed by line and the first changed file.
                 removing_boilerplate = True
             elif removing_boilerplate:
diff --git a/WebKitTools/Scripts/webkitpy/changelogs_unittest.py b/WebKitTools/Scripts/webkitpy/changelogs_unittest.py
index dd14cb7..d8e8158 100644
--- a/WebKitTools/Scripts/webkitpy/changelogs_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/changelogs_unittest.py
@@ -124,22 +124,35 @@ class ChangeLogsTest(unittest.TestCase):
         os.remove(changelog_path)
         self.assertEquals(actual_contents, expected_contents)
 
-    _expected_revert_entry = '''2009-08-19  Eric Seidel  <eric at webkit.org>
+    _revert_entry_with_bug_url = '''2009-08-19  Eric Seidel  <eric at webkit.org>
 
         No review, rolling out r12345.
         http://trac.webkit.org/changeset/12345
+        http://example.com/123
 
         * Scripts/bugzilla-tool:
 '''
 
-    def test_update_for_revert(self):
+    _revert_entry_without_bug_url = '''2009-08-19  Eric Seidel  <eric at webkit.org>
+
+        No review, rolling out r12345.
+        http://trac.webkit.org/changeset/12345
+
+        * Scripts/bugzilla-tool:
+'''
+
+    def _assert_update_for_revert_output(self, args, expected_entry):
         changelog_contents = "%s\n%s" % (self._new_entry_boilerplate, self._example_changelog)
         changelog_path = self._write_tmp_file_with_contents(changelog_contents)
         changelog = ChangeLog(changelog_path)
-        changelog.update_for_revert(12345)
+        changelog.update_for_revert(*args)
         actual_entry = changelog.latest_entry()
         os.remove(changelog_path)
-        self.assertEquals(actual_entry, self._expected_revert_entry)
+        self.assertEquals(actual_entry, expected_entry)
+
+    def test_update_for_revert(self):
+        self._assert_update_for_revert_output([12345], self._revert_entry_without_bug_url)
+        self._assert_update_for_revert_output([12345, "http://example.com/123"], self._revert_entry_with_bug_url)
 
 if __name__ == '__main__':
     unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/steps/preparechangelogforrevert.py b/WebKitTools/Scripts/webkitpy/steps/preparechangelogforrevert.py
index 99f392b..2eff15d 100644
--- a/WebKitTools/Scripts/webkitpy/steps/preparechangelogforrevert.py
+++ b/WebKitTools/Scripts/webkitpy/steps/preparechangelogforrevert.py
@@ -42,5 +42,6 @@ class PrepareChangeLogForRevert(AbstractStep):
         # Second, make new ChangeLog entries for this rollout.
         # This could move to prepare-ChangeLog by adding a --revert= option.
         self._run_script("prepare-ChangeLog")
+        bug_url = self._tool.bugs.bug_url_for_bug_id(state["bug_id"]) if state["bug_id"] else None
         for changelog_path in changelog_paths:
-            ChangeLog(changelog_path).update_for_revert(state["revision"])
+            ChangeLog(changelog_path).update_for_revert(state["revision"], bug_url)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list