<?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>29059</bug_id>
          
          <creation_ts>2009-09-08 17:45:50 -0700</creation_ts>
          <short_desc>svn-apply doesn&apos;t handle changes to files copied to new directories properly</short_desc>
          <delta_ts>2009-09-09 17:01:15 -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>Mac (Intel)</rep_platform>
          <op_sys>OS X 10.5</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>
          
          <blocked>29001</blocked>
    
    <blocked>29058</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Cameron McCormack (:heycam)">heycam</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>eric</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>145606</commentid>
    <comment_count>0</comment_count>
    <who name="Cameron McCormack (:heycam)">heycam</who>
    <bug_when>2009-09-08 17:45:50 -0700</bug_when>
    <thetext>The output of svn-create-patch trips up svn-apply when a file has been copied to a newly added directory and changes have been made to the copy.  Compare these two diffs:

$ cd WebKitTools
$ svn cp Makefile Scripts   # Copy file into an existing directory.
A         Scripts/Makefile
$ echo &gt;&gt;Makefile           # Make a change to the copy.
$ svn-create-patch | egrep &apos;^(--|\+\+)&apos;
--- Scripts/Makefile    (revision 48142)        (from Makefile:48142)
+++ Scripts/Makefile    (working copy)
--- Scripts/Makefile    (revision 48142)
+++ Scripts/Makefile    (working copy)


and:


$ cd WebKitTools
$ mkdir NewDirectory
$ svn add NewDirectory
A         NewDirectory
$ svn cp Makefile NewDirectory   # Copy file into a new directory.
A         NewDirectory/Makefile
$ echo &gt;&gt;Makefile                # Make a change to the copy.
$ svn-create-patch | egrep &apos;^(--|\+\+)&apos;
--- NewDirectory/Makefile       (revision 48142)        (from Makefile:48142)
+++ NewDirectory/Makefile       (working copy)
--- NewDirectory/Makefile       (revision 0)
+++ NewDirectory/Makefile       (working copy)


So when the diff of the copied file in the new directory is created it says &quot;revision 0&quot;, making svn-apply think that it is a new file, whereas it has already copied it in the first part of the patch.  svn-apply moves the copied file out of the way to Makefile.orig and then fails when attempting to apply the second part of the patch (since NewDirectory/Makefile doesn&apos;t exist now).

I guess that the &quot;revision 0&quot; output comes from &quot;svn diff&quot; itself; you can see that &quot;svn info&quot; gives different revision info for the two copies:

$ svn info Scripts/Makefile | grep ^Revision
Revision: 48142

$ svn info NewDirectory/Makefile | grep ^Revision
Revision: 0

So one way to fix this would be to change svn-apply to recognise this case and not treat the second part of the patch there as a new file.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>145608</commentid>
    <comment_count>1</comment_count>
      <attachid>39236</attachid>
    <who name="Cameron McCormack (:heycam)">heycam</who>
    <bug_when>2009-09-08 17:48:53 -0700</bug_when>
    <thetext>Created attachment 39236
Patch v1

This makes the suggested change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>145760</commentid>
    <comment_count>2</comment_count>
      <attachid>39236</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-09-09 08:10:09 -0700</bug_when>
    <thetext>Comment on attachment 39236
Patch v1

Looks sane.  Ideally we&apos;d have some unit testing, which is possible (although slightly awkward) using WebKitTools/Scripts/modules/scm_unittest.py.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>145989</commentid>
    <comment_count>3</comment_count>
      <attachid>39236</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2009-09-09 16:03:07 -0700</bug_when>
    <thetext>Comment on attachment 39236
Patch v1

Rejecting patch 39236 from commit-queue.

This patch will require manual commit. Patch https://bugs.webkit.org/attachment.cgi?id=39236 from bug 29059 failed to download and apply.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>145990</commentid>
    <comment_count>4</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-09-09 16:03:39 -0700</bug_when>
    <thetext>Hunk #1 succeeded at 1 with fuzz 3.
can&apos;t find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: Scripts/svn-apply
|===================================================================
|--- Scripts/svn-apply	(revision 48142)
|+++ Scripts/svn-apply	(working copy)
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>145991</commentid>
    <comment_count>5</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-09-09 16:04:32 -0700</bug_when>
    <thetext>Looks like you didn&apos;t use svn-create-patch to make this.  It&apos;s been made from the WebKitTools directory instead of the root.  svn-create-patch should automatically create patches with full paths for you.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>145993</commentid>
    <comment_count>6</comment_count>
      <attachid>39308</attachid>
    <who name="Cameron McCormack (:heycam)">heycam</who>
    <bug_when>2009-09-09 16:11:38 -0700</bug_when>
    <thetext>Created attachment 39308
Patch v2

Huh.  I&apos;m pretty sure I did use svn-create-patch, but I probably did run it from WebKitTools/ (just to save it churning through the rest of the checkout for minutes only to find no changes).  Anyway, here&apos;s one with full paths.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>145995</commentid>
    <comment_count>7</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-09-09 16:15:59 -0700</bug_when>
    <thetext>svn-create-patch will make patches with full paths regardless of where you run it from.  Unless you&apos;re running an old version somehow?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>145996</commentid>
    <comment_count>8</comment_count>
      <attachid>39308</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-09-09 16:16:42 -0700</bug_when>
    <thetext>Comment on attachment 39308
Patch v2

OK.  Still would love to see more unit tests for these scripts now that we have scm_unittest.py. :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>146004</commentid>
    <comment_count>9</comment_count>
      <attachid>39308</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2009-09-09 16:41:51 -0700</bug_when>
    <thetext>Comment on attachment 39308
Patch v2

Clearing flags on attachment: 39308

Committed r48236: &lt;http://trac.webkit.org/changeset/48236&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>146005</commentid>
    <comment_count>10</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2009-09-09 16:41:55 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>146015</commentid>
    <comment_count>11</comment_count>
    <who name="Cameron McCormack (:heycam)">heycam</who>
    <bug_when>2009-09-09 16:58:53 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; svn-create-patch will make patches with full paths regardless of where you run
&gt; it from.  Unless you&apos;re running an old version somehow?

Seems not (at least not on my machine):

$ pwd
/Users/cam/svn/WebKit-2/WebKitTools
$ echo &gt;&gt;Scripts/svn-create-patch
$ ./Scripts/svn-create-patch 
Index: Scripts/svn-create-patch
===================================================================
--- Scripts/svn-create-patch    (revision 48236)
+++ Scripts/svn-create-patch    (working copy)
@@ -457,3 +457,4 @@ sub testfilecmp($$)
     return $fileDataA-&gt;{isTestFile} &lt;=&gt; $fileDataB-&gt;{isTestFile};
 }
 
+
$ svn diff -rBASE:HEAD Scripts/svn-create-patch
$</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>146017</commentid>
    <comment_count>12</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-09-09 17:00:47 -0700</bug_when>
    <thetext>Such was supposed to be fixed by bug 26999.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>146018</commentid>
    <comment_count>13</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-09-09 17:01:15 -0700</bug_when>
    <thetext>If you find it&apos;s regressed, please file a bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>39236</attachid>
            <date>2009-09-08 17:48:53 -0700</date>
            <delta_ts>2009-09-09 16:11:38 -0700</delta_ts>
            <desc>Patch v1</desc>
            <filename>29059-v1.patch</filename>
            <type>text/plain</type>
            <size>1271</size>
            <attacher name="Cameron McCormack (:heycam)">heycam</attacher>
            
              <data encoding="base64">SW5kZXg6IENoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBDaGFuZ2VMb2cJKHJldmlzaW9uIDQ4MTk1
KQorKysgQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTMgQEAKKzIwMDktMDkt
MDggIENhbWVyb24gTWNDb3JtYWNrICA8Y2FtQG1jYy5pZC5hdT4KKworICAgICAgICBSZXZpZXdl
ZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBzdm4tYXBwbHkgZG9lc24ndCBoYW5kbGUg
Y2hhbmdlcyB0byBmaWxlcyBjb3BpZWQgdG8gbmV3IGRpcmVjdG9yaWVzIHByb3Blcmx5CisgICAg
ICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0yOTA1OQorCisgICAg
ICAgICogU2NyaXB0cy9zdm4tYXBwbHk6IERvbid0IHRyZWF0ICItLS0gcmV2aXNpb24gMCIgcGF0
Y2hlcyBhcyBiZ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name="review"
          id="20300"
          type_id="1"
          status="+"
          setter="eric"
    />
    <flag name="commit-queue"
          id="20386"
          type_id="3"
          status="-"
          setter="commit-queue"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>39308</attachid>
            <date>2009-09-09 16:11:38 -0700</date>
            <delta_ts>2009-09-09 16:41:51 -0700</delta_ts>
            <desc>Patch v2</desc>
            <filename>29059-v2.patch</filename>
            <type>text/plain</type>
            <size>1343</size>
            <attacher name="Cameron McCormack (:heycam)">heycam</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYktpdFRvb2xzL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBXZWJLaXRUb29scy9D
aGFuZ2VMb2cJKHJldmlzaW9uIDQ4MTk2KQorKysgV2ViS2l0VG9vbHMvQ2hhbmdlTG9nCSh3b3Jr
aW5nIGNvcHkpCkBAIC0xLDMgKzEsMTMgQEAKKzIwMDktMDktMDkgIENhbWVyb24gTWNDb3JtYWNr
ICA8Y2FtQG1jYy5pZC5hdT4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4K
KworICAgICAgICBzdm4tYXBwbHkgZG9lc24ndCBoYW5kbGUgY2hhbmdlcyB0byBmaWxlcyBjb3Bp
ZWQgdG8gbmV3IGRpcmVjdG9yaWVzIHByb3Blcmx5CisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJr
aXQub3JnL3Nob3dfYnVnLmNnaT9pZD0yOTA1OQorCisgICAgICAgICogU2NyaXB0cy9zdm4tYXBw
bHk6IERvbid0IHRyZWF0ICItLS0gcmV2aXNpb24gMCIgcGF0Y2hlcyBhcyBiZWluZworICAgICAg
ICBhZGRpdGlvbnMgaWYgd2Uga25vdyB0aGF0IHdlJ3ZlIGp1c3QgY29waWVkIGEgZmlsZSB0byB0
aGlzIG5hbWUuCisKIDIwMDktMDktMDggIE1hcmsgUm93ZSAgPG1yb3dlQGFwcGxlLmNvbT4KIAog
ICAgICAgICBGaXggYW4gaW5jb3JyZWN0IHZhcmlhYmxlIG5hbWUgaW4gVXBkYXRlQ2hyb21pdW1T
b3VyY2UuCkluZGV4OiBXZWJLaXRUb29scy9TY3JpcHRzL3N2bi1hcHBseQo9PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0t
LSBXZWJLaXRUb29scy9TY3JpcHRzL3N2bi1hcHBseQkocmV2aXNpb24gNDgxNDIpCisrKyBXZWJL
aXRUb29scy9TY3JpcHRzL3N2bi1hcHBseQkod29ya2luZyBjb3B5KQpAQCAtMzgwLDcgKzM4MCw3
IEBAIHN1YiBwYXRjaCgkKQogICAgIG15ICRhZGRpdGlvbiA9IDA7CiAgICAgbXkgJGlzQmluYXJ5
ID0gMDsKIAotICAgICRhZGRpdGlvbiA9IDEgaWYgKCRwYXRjaCA9fiAvXG4tLS0gLitcKHJldmlz
aW9uIDBcKVxyP1xuLyB8fCAkcGF0Y2ggPX4gL1xuQEAgLTAsMCAuKiBAQC8pOworICAgICRhZGRp
dGlvbiA9IDEgaWYgKCRwYXRjaCA9fiAvXG4tLS0gLitcKHJldmlzaW9uIDBcKVxyP1xuLyB8fCAk
cGF0Y2ggPX4gL1xuQEAgLTAsMCAuKiBAQC8pICYmICFleGlzdHMoJGNvcGllZEZpbGVzeyRmdWxs
UGF0aH0pOwogICAgICRkZWxldGlvbiA9IDEgaWYgJHBhdGNoID1+IC9cbkBAIC4qIFwrMCwwIEBA
LzsKICAgICAkaXNCaW5hcnkgPSAxIGlmICRwYXRjaCA9fiAvXG5DYW5ub3QgZGlzcGxheTogZmls
ZSBtYXJrZWQgYXMgYSBiaW5hcnkgdHlwZVwuLzsKIAo=
</data>

          </attachment>
      

    </bug>

</bugzilla>