[Webkit-unassigned] [Bug 36257] REGRESSION: svn-apply does not handle overlapping diffs?

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 17 23:45:28 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=36257





--- Comment #3 from Chris Jerdonek <cjerdonek at webkit.org>  2010-03-17 23:45:28 PST ---
It looks like the test is failing for at least two reasons.

The first issue is that the test case does not include a leading space in the
unchanged lines empty lines (so that all lines are offset by the same amount):

        one_line_overlap_patch = """Index: ChangeLog
===================================================================
--- ChangeLog    (revision 5)
+++ ChangeLog    (working copy)
@@ -1,5 +1,13 @@
 2009-10-26  Eric Seidel  <eric at webkit.org>
 <-- no leading space
+        Reviewed by NOBODY (OOPS!).
+
+        Second most awesome change ever.
+
+        * scm_unittest.py:
+
+2009-10-26  Eric Seidel  <eric at webkit.org>
+
         Reviewed by Foo Bar.
 <-- no leading space
         Most awesome change ever.
"""

fixChangeLogPatch expects each line to have at least one character.  I don't
expect this to be an issue in practice since git diff, etc do this.  So this
can be fixed by adding the leading space to the test cases, or better yet,
making fixChangeLogPatch more lenient.

If we fixChangeLogPatch, we should add additional test cases to
fixChangeLogPatch.pl.

The second issue is unrelated.  I added the spaces and got this as the result:

WebKitTools/Scripts/webkitpy/scm_unittest.py", line 406, in test_svn_apply
    self.assertEquals(read_from_path('ChangeLog'), expected_changelog_contents)
AssertionError: '2010-03-17  Eric Seidel  <eric at webkit.org>\n\n        Reviewed
by NOBODY (OOPS!).\n\n        Second most awesome change ever.\n\n        *
scm_unittest.py:\n\n2009-10-27  Eric Seidel  <eric at webkit.org>\n\n       
Reviewed by Baz Bar.\n\n        A more awesomer change yet!\n\n        *
scm_unittest.py:\n\n2009-10-26  Eric Seidel  <eric at webkit.org>\n\n       
Reviewed by Foo Bar.\n\n        Most awesome change ever.\n\n        *
scm_unittest.py:\n' != '2010-03-17  Eric Seidel  <eric at webkit.org>\n\n       
Reviewed by Joe Cool.\n\n        Second most awesome change ever.\n\n        *
scm_unittest.py:\n\n2009-10-27  Eric Seidel  <eric at webkit.org>\n\n       
Reviewed by Baz Bar.\n\n        A more awesomer change yet!\n\n        *
scm_unittest.py:\n\n2009-10-26  Eric Seidel  <eric at webkit.org>\n\n       
Reviewed by Foo Bar.\n\n        Most awesome change ever.\n\n        *
scm_unittest.py:\n'

It looks like the unit test is not setting the reviewer correctly -- in the way
that bugzilla.py expects.

scm_unittest.py does this--

    def _create_patch(self, patch_contents):
        patch_path = os.path.join(self.svn_checkout_path, 'patch.diff')
        write_into_file_at_path(patch_path, patch_contents)
        patch = {}
        patch['reviewer'] = 'Joe Cool'
        patch['bug_id'] = '12345'
        patch['url'] = 'file://%s' % urllib.pathname2url(patch_path)
        return Attachment(patch, None) # FIXME: This is a hack, scm.py
shouldn't be fetching attachment data.

But bugzilla.py seems to return None for the reviewer when patch.reviewer() is
called:

    def reviewer(self):
        if not self._reviewer:
            self._reviewer = self._validate_flag_value("reviewer")
        return self._reviewer

This seems to be because the validate_flag_value method is looking at other
keys:

    def _validate_flag_value(self, flag):
        email = self._attachment_dictionary.get("%s_email" % flag)
        if not email:
            return None

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list