Bug 9875 - Teach svn-apply and svn-unapply to use patch(1) for additions and deletions
Summary: Teach svn-apply and svn-unapply to use patch(1) for additions and deletions
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-12 08:59 PDT by David Kilzer (:ddkilzer)
Modified: 2006-07-16 21:10 PDT (History)
1 user (show)

See Also:


Attachments
Patch v1 (7.92 KB, patch)
2006-07-15 20:07 PDT, David Kilzer (:ddkilzer)
darin: review+
Details | Formatted Diff | Diff
Patch to clean up "No newline" and "Property changes" droppings (4.14 KB, patch)
2006-07-15 21:06 PDT, David Kilzer (:ddkilzer)
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.