Bug 9875

Summary: Teach svn-apply and svn-unapply to use patch(1) for additions and deletions
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: Tools / TestsAssignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: RESOLVED FIXED    
Severity: Normal CC: darin
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
Patch v1
darin: review+
Patch to clean up "No newline" and "Property changes" droppings darin: review+

Description David Kilzer (:ddkilzer) 2006-07-12 08:59:22 PDT
The patch for Bug 9806 (attachment 9350 [details]) contained property changes for text files.  The svn-apply script doesn't handle these well since they get included in the file created!  The proper fix is to use the patch(1) command for additions and deletions of files, since it's smart enough to ignore the non-patch bits.

Note that the "\No newline at end of file" markers are also being included at the end of text files because of this bug.  See r15232.

I've got a patch to do this, but it needs a bit more testing first.
Comment 1 David Kilzer (:ddkilzer) 2006-07-12 09:01:23 PDT
For my next trick (a different bug), I will make svn-apply and svn-unapply use the property change information in such patches to update properties when fed patches.

Comment 2 David Kilzer (:ddkilzer) 2006-07-15 20:07:22 PDT
Created attachment 9473 [details]
Patch v1

Most of the changes are self-explanitory.

The worst code is for reversing a deletion.
- We handle a local file existing (when one shouldn't) by renaming it to *.orig.
- We unapply the deletion (which creates the file), but we rename it to a temp file name before running svn revert in case the contents are the same.
- After we rename the temp file back to the original file name, we must work around a timestamp bug in Subversion where the svn client thinks the file hasn't change if its timestamp isn't sufficiently different.
Comment 3 David Kilzer (:ddkilzer) 2006-07-15 21:06:58 PDT
Created attachment 9474 [details]
Patch to clean up "No newline" and "Property changes" droppings

This patch cleans up the "No newline" and "Property changes" text in various files that should not have been included when files were checked in.
Comment 4 Darin Adler 2006-07-16 15:26:20 PDT
Comment on attachment 9473 [details]
Patch v1

Looks good. r=me
Comment 5 David Kilzer (:ddkilzer) 2006-07-16 21:10:07 PDT
Attachment 9473 [details] (Patch v1) committed as revision 15477.
Attachment 9474 [details] (clean up) committed as revision 15478.