Changeset 84549 in webkit


Ignore:
Timestamp:
Apr 21, 2011 3:00:54 PM (13 years ago)
Author:
abarth@webkit.org
Message:

2011-04-21 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

ValidateChangeLogs doesn't work on SVN
https://bugs.webkit.org/show_bug.cgi?id=59115

svn-create-patch lies about the diff in the working copy by moving
ChangeLog entries to the top of the diff. That's fine on most cases,
but causes problems for ValidateChangeLogs, which is trying validate
the where the ChangeLog entry appears.

I haven't added a test for this change because I couldn't figure out
how to write one. The issue is more of an integration issue, which
we're not really set up to test in our unit testing framework. If this
patch had worked around the output from svn-create-patch, then I could
have tested that we behave correctly on sample svn-create-patch output,
but, in this case, I've removed the dependency on svn-create-patch. I
could test that we behave correctly on "svn diff" output, but we
already have those tests.

  • Scripts/webkitpy/tool/commands/download_unittest.py:
  • Scripts/webkitpy/tool/mocktool.py:
  • Scripts/webkitpy/tool/steps/validatechangelogs.py:
Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r84544 r84549  
     12011-04-21  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        ValidateChangeLogs doesn't work on SVN
     6        https://bugs.webkit.org/show_bug.cgi?id=59115
     7
     8        svn-create-patch lies about the diff in the working copy by moving
     9        ChangeLog entries to the top of the diff.  That's fine on most cases,
     10        but causes problems for ValidateChangeLogs, which is trying validate
     11        the where the ChangeLog entry appears.
     12
     13        I haven't added a test for this change because I couldn't figure out
     14        how to write one.  The issue is more of an integration issue, which
     15        we're not really set up to test in our unit testing framework.  If this
     16        patch had worked around the output from svn-create-patch, then I could
     17        have tested that we behave correctly on sample svn-create-patch output,
     18        but, in this case, I've removed the dependency on svn-create-patch.  I
     19        could test that we behave correctly on "svn diff" output, but we
     20        already have those tests.
     21
     22        * Scripts/webkitpy/tool/commands/download_unittest.py:
     23        * Scripts/webkitpy/tool/mocktool.py:
     24        * Scripts/webkitpy/tool/steps/validatechangelogs.py:
     25
    1262011-04-21  Tony Chang  <tony@chromium.org>
    227
  • trunk/Tools/Scripts/webkitpy/tool/commands/download_unittest.py

    r83158 r84549  
    114114        self.assert_execute_outputs(Land(), [42], options=self._default_options(), expected_stderr=expected_stderr, tool=mock_tool)
    115115        # Make sure we're not calling expensive calls too often.
    116         self.assertEqual(mock_tool.scm().create_patch.call_count, 1)
     116        self.assertEqual(mock_tool.scm().create_patch.call_count, 0)
    117117        self.assertEqual(mock_tool.checkout().modified_changelogs.call_count, 1)
    118118
  • trunk/Tools/Scripts/webkitpy/tool/mocktool.py

    r84455 r84549  
    536536        })
    537537
     538    def is_path_to_changelog(self, path):
     539        return os.path.basename(path) == "ChangeLog"
     540
    538541    def bug_id_for_revision(self, svn_revision):
    539542        return 12345
  • trunk/Tools/Scripts/webkitpy/tool/steps/validatechangelogs.py

    r75328 r84549  
    5656
    5757    def run(self, state):
    58         parsed_diff = DiffParser(self.cached_lookup(state, "diff").splitlines())
    59         for filename, diff_file in parsed_diff.files.items():
    60             if not self._check_changelog_diff(diff_file):
    61                 error("ChangeLog entry in %s is not at the top of the file." % diff_file.filename)
     58        changed_files = self.cached_lookup(state, "changed_files")
     59        for filename in changed_files:
     60            if not self._tool.checkout().is_path_to_changelog(filename):
     61                continue
     62            # Diff ChangeLogs directly because svn-create-patch will move
     63            # ChangeLog entries to the # top automatically, defeating our
     64            # validation here.
     65            # FIXME: Should we diff all the ChangeLogs at once?
     66            diff = self._tool.scm().diff_for_file(filename)
     67            parsed_diff = DiffParser(diff.splitlines())
     68            for filename, diff_file in parsed_diff.files.items():
     69                if not self._check_changelog_diff(diff_file):
     70                    error("ChangeLog entry in %s is not at the top of the file." % diff_file.filename)
Note: See TracChangeset for help on using the changeset viewer.