<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>38507</bug_id>
          
          <creation_ts>2010-05-03 22:41:12 -0700</creation_ts>
          <short_desc>REGRESSION: svn-apply can&apos;t handle patches with leading junk</short_desc>
          <delta_ts>2010-05-04 08:09:57 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Chris Jerdonek">cjerdonek</reporter>
          <assigned_to name="Chris Jerdonek">cjerdonek</assigned_to>
          <cc>abarth</cc>
    
    <cc>cjerdonek</cc>
    
    <cc>dbates</cc>
    
    <cc>eric</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>220478</commentid>
    <comment_count>0</comment_count>
    <who name="Chris Jerdonek">cjerdonek</who>
    <bug_when>2010-05-03 22:41:12 -0700</bug_when>
    <thetext>svn-apply no longer handles patches with leading junk, e.g. e-mail diffs:

https://bugs.webkit.org/show_bug.cgi?id=38439#c5
https://bugs.webkit.org/show_bug.cgi?id=38455#c6

The explanation is as follows:

Previously, if a patch contained leading junk, the code for svn-apply would parse the leading junk into its own &quot;patch&quot; in the array of patches to apply.  When svn-apply&apos;s patch() subroutine got to this bad patch, svn-apply would skip over it provided the --force option was used (which is what the commit-queue uses).

After the following revision--

http://trac.webkit.org/changeset/58495

svn-apply combined any leading junk in with the patch following it.  This meant that svn-apply&apos;s patch() subroutine would now skip over the patch corresponding to that file whenever the --force option was used.  In cases where the ChangeLog entry was the first valid patch after any leading junk (e.g. in the case of many e-mail diffs), this meant that svn-apply would skip over applying the ChangeLog part of the patch -- leading to error messages of the form &quot;Found no modified ChangeLogs&quot;.

One possible solution to this issue is pretty easy and will also solve the following issue:

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

I will submit a fix shortly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>220480</commentid>
    <comment_count>1</comment_count>
      <attachid>54997</attachid>
    <who name="Chris Jerdonek">cjerdonek</who>
    <bug_when>2010-05-03 23:03:50 -0700</bug_when>
    <thetext>Created attachment 54997
Proposed patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>220481</commentid>
    <comment_count>2</comment_count>
      <attachid>54997</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-05-03 23:08:30 -0700</bug_when>
    <thetext>Comment on attachment 54997
Proposed patch

I&apos;m not an expert here, but this looks sane.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>220482</commentid>
    <comment_count>3</comment_count>
      <attachid>54997</attachid>
    <who name="Chris Jerdonek">cjerdonek</who>
    <bug_when>2010-05-03 23:14:46 -0700</bug_when>
    <thetext>Comment on attachment 54997
Proposed patch

Clearing flags on attachment: 54997

Committed r58735: &lt;http://trac.webkit.org/changeset/58735&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>220483</commentid>
    <comment_count>4</comment_count>
    <who name="Chris Jerdonek">cjerdonek</who>
    <bug_when>2010-05-03 23:14:57 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>220578</commentid>
    <comment_count>5</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2010-05-04 07:09:40 -0700</bug_when>
    <thetext>Where are the unit tests for either of the two bugs fixed by this change?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>220590</commentid>
    <comment_count>6</comment_count>
    <who name="Chris Jerdonek">cjerdonek</who>
    <bug_when>2010-05-04 08:05:24 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; Where are the unit tests for either of the two bugs fixed by this change?

Bug 33119 is a special case of this bug so it can be handled by the same test cases.

The problem was in an area of the Perl code that is not currently covered by any unit tests (the patch() subroutines of both the svn-apply file and the svn-unapply file).  It would take a bit more scaffolding or refactoring to add test coverage to that change.

The most that could probably be done at this point would be to add an &quot;end-to-end&quot; test to scm_unittest.py that would run as part of &quot;test-webkitpy --all&quot;.

Perhaps we could get away with simply adding leading junk to a couple of the existing unit test cases: one for Git and one for SVN.

I&apos;ll file a bug report.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>220593</commentid>
    <comment_count>7</comment_count>
    <who name="Chris Jerdonek">cjerdonek</who>
    <bug_when>2010-05-04 08:09:57 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; 
&gt; I&apos;ll file a bug report.

Filed bug report here:

https://bugs.webkit.org/show_bug.cgi?id=38519</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>54997</attachid>
            <date>2010-05-03 23:03:50 -0700</date>
            <delta_ts>2010-05-03 23:14:46 -0700</delta_ts>
            <desc>Proposed patch</desc>
            <filename>_patch-38507-1.diff</filename>
            <type>text/plain</type>
            <size>2508</size>
            <attacher name="Chris Jerdonek">cjerdonek</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYktpdFRvb2xzL0NoYW5nZUxvZyBiL1dlYktpdFRvb2xzL0NoYW5nZUxv
ZwppbmRleCA3NjJlN2E2Li42ZWJjNWE1IDEwMDY0NAotLS0gYS9XZWJLaXRUb29scy9DaGFuZ2VM
b2cKKysrIGIvV2ViS2l0VG9vbHMvQ2hhbmdlTG9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ByZXR1cm47Ci0gICAgfQotICAgIG15ICRmdWxs
UGF0aCA9ICQxOworICAgIG15ICRmdWxsUGF0aCA9ICRkaWZmSGFzaFJlZi0+e2luZGV4UGF0aH07
CiAKICAgICBteSAkZGVsZXRpb24gPSAwOwogICAgIG15ICRhZGRpdGlvbiA9IDA7CmRpZmYgLS1n
aXQgYS9XZWJLaXRUb29scy9TY3JpcHRzL3N2bi11bmFwcGx5IGIvV2ViS2l0VG9vbHMvU2NyaXB0
cy9zdm4tdW5hcHBseQppbmRleCA0NzViZjY4Li40NjVhZDU3IDEwMDc1NQotLS0gYS9XZWJLaXRU
b29scy9TY3JpcHRzL3N2bi11bmFwcGx5CisrKyBiL1dlYktpdFRvb2xzL1NjcmlwdHMvc3ZuLXVu
YXBwbHkKQEAgLTE0MCwxMyArMTQwLDggQEAgc3ViIHBhdGNoKCQpCiAgICAgbXkgKCRkaWZmSGFz
aFJlZikgPSBAXzsKIAogICAgIG15ICRwYXRjaCA9ICRkaWZmSGFzaFJlZi0+e3N2bkNvbnZlcnRl
ZFRleHR9OworICAgIG15ICRmdWxsUGF0aCA9ICRkaWZmSGFzaFJlZi0+e2luZGV4UGF0aH07CiAK
LSAgICB1bmxlc3MgKCRwYXRjaCA9fiBtfF5JbmRleDogKFteXHJcbl0rKXwpIHsKLSAgICAgICAg
bXkgJHNlcGFyYXRvciA9ICctJyB4IDY3OwotICAgICAgICB3YXJuICJGYWlsZWQgdG8gZmluZCAn
SW5kZXg6JyBpbjpcbiRzZXBhcmF0b3JcbiRwYXRjaFxuJHNlcGFyYXRvclxuIjsKLSAgICAgICAg
cmV0dXJuOwotICAgIH0KLSAgICBteSAkZnVsbFBhdGggPSAkMTsKICAgICAkZGlyZWN0b3JpZXNU
b0NoZWNre2Rpcm5hbWUoJGZ1bGxQYXRoKX0gPSAxOwogCiAgICAgbXkgJGRlbGV0aW9uID0gMDsK
</data>

          </attachment>
      

    </bug>

</bugzilla>