| Differences between
and this patch
- a/Tools/ChangeLog +23 lines
Lines 1-3 a/Tools/ChangeLog_sec1
1
2016-09-07  Emanuele Aina  <emanuele.aina@collabora.com>
2
3
        Replace bug URL placeholders independently of the short desc one
4
        https://bugs.webkit.org/show_bug.cgi?id=161684
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Instead of adding the bug URL when replacing the short description
9
        placeholder and then ignoring the bug URL placeholder, use the former
10
        to set the short description and the latter for the bug URL.
11
        This means that developers can fully prepare the changelog with short
12
        and long description before submission leaving the bug placeholder in
13
        place, and the changelog machinery will make sure to replace the
14
        latter with the URL of the newly created bug while submitting.
15
16
        Note that this also means that the short description placeholder alone
17
        no longer causes the bug URL to be added.
18
19
        * Scripts/webkitpy/common/checkout/changelog.py:
20
        (ChangeLog.set_short_description_and_bug_url):
21
        * Scripts/webkitpy/common/checkout/changelog_unittest.py:
22
        (test_set_short_description_and_bug_url):
23
1
2016-09-12  Chris Dumez  <cdumez@apple.com>
24
2016-09-12  Chris Dumez  <cdumez@apple.com>
2
25
3
        Fix post-landing review comments after r205787
26
        Fix post-landing review comments after r205787
- a/Tools/Scripts/webkitpy/common/checkout/changelog.py -5 / +8 lines
Lines 430-443 def set_reviewer(self, reviewer): a/Tools/Scripts/webkitpy/common/checkout/changelog.py_sec1
430
            self._filesystem.write_text_file(self.path, newdata)
430
            self._filesystem.write_text_file(self.path, newdata)
431
431
432
    def set_short_description_and_bug_url(self, short_description, bug_url):
432
    def set_short_description_and_bug_url(self, short_description, bug_url):
433
        message = "%s\n%s%s" % (short_description, self._changelog_indent, bug_url)
434
        bug_boilerplate = "%sNeed the bug URL (OOPS!).\n" % self._changelog_indent
435
        result = StringIO()
433
        result = StringIO()
436
        with self._filesystem.open_text_file_for_reading(self.path) as file:
434
        with self._filesystem.open_text_file_for_reading(self.path) as file:
435
            short_description_placeholder = "Need a short description (OOPS!)."
436
            bug_url_placeholder = "Need the bug URL (OOPS!)."
437
            for line in file:
437
            for line in file:
438
                line = line.replace("Need a short description (OOPS!).", message)
438
                stripped = line.strip()
439
                if line != bug_boilerplate:
439
                if stripped == short_description_placeholder:
440
                    result.write(line)
440
                    line = self._changelog_indent + short_description + "\n"
441
                if stripped == bug_url_placeholder:
442
                    line = self._changelog_indent + bug_url + "\n"
443
                result.write(line)
441
        self._filesystem.write_text_file(self.path, result.getvalue())
444
        self._filesystem.write_text_file(self.path, result.getvalue())
442
445
443
    def delete_entries(self, num_entries):
446
    def delete_entries(self, num_entries):
- a/Tools/Scripts/webkitpy/common/checkout/changelog_unittest.py -2 / +1 lines
Lines 642-649 def test_set_short_description_and_bug_url(self): a/Tools/Scripts/webkitpy/common/checkout/changelog_unittest.py_sec1
642
        bug_url = "http://example.com/b/2344"
642
        bug_url = "http://example.com/b/2344"
643
        ChangeLog(self._changelog_path, fs).set_short_description_and_bug_url(short_description, bug_url)
643
        ChangeLog(self._changelog_path, fs).set_short_description_and_bug_url(short_description, bug_url)
644
        actual_contents = fs.read_text_file(self._changelog_path)
644
        actual_contents = fs.read_text_file(self._changelog_path)
645
        expected_message = "%s\n        %s" % (short_description, bug_url)
645
        expected_contents = changelog_contents.replace("Need a short description (OOPS!).", short_description)
646
        expected_contents = changelog_contents.replace("Need a short description (OOPS!).", expected_message)
647
        self.assertEqual(actual_contents.splitlines(), expected_contents.splitlines())
646
        self.assertEqual(actual_contents.splitlines(), expected_contents.splitlines())
648
647
649
        changelog_contents = u"%s\n%s" % (self._new_entry_boilerplate, self._example_changelog)
648
        changelog_contents = u"%s\n%s" % (self._new_entry_boilerplate, self._example_changelog)

Return to Bug 161684