Bug 21850 - svn-apply and svn-unapply should preserve patch line endings
Summary: svn-apply and svn-unapply should preserve patch line endings
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2008-10-23 21:41 PDT by David Kilzer (:ddkilzer)
Modified: 2020-12-01 10:21 PST (History)
5 users (show)

See Also:


Attachments
Patch v1 (1.90 KB, patch)
2008-10-23 21:58 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff
Patch (1.88 KB, patch)
2020-11-08 11:04 PST, Rob Buis
no flags 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) 2008-10-23 21:41:53 PDT
* SUMMARY
When applying (or unapplying) a patch, svn-apply and svn-unapply will remove all "native" line endings from a patch, and replace then with "\n".  This causes problems when a patch contains more than one type of line ending (such as changes to a *.vcproj file and a *.pbxproj file in the same patch).

* STEPS TO REPRODUCE
0. On a Mac OS X system.
1. Make changes to *.pbxproj and *.vcproj files.
2. Use svn-create-patch to create a patch of the changes.
3. Use svn-unapply to revert the changes using the patch file.

3a. Alternatively, use svn revert to back out the changes, then use svn-apply with the patch file.

* RESULTS
The svn-unapply or svn-apply operation will fail because the "native" line endings in the patch are currently stripped by the scripts.

* NOTES
Instead, both scripts should preserve the line endings for each patch, since the patch(1) command knows how to deal with them anyway.
Comment 1 David Kilzer (:ddkilzer) 2008-10-23 21:58:25 PDT
Created attachment 24634 [details]
Patch v1

Proposed fix.
Comment 2 Adam Roben (:aroben) 2008-10-24 07:30:53 PDT
Comment on attachment 24634 [details]
Patch v1

r=me
Comment 3 David Kilzer (:ddkilzer) 2008-10-24 11:20:16 PDT
$ svn commit WebKitTools
Sending        WebKitTools/ChangeLog
Sending        WebKitTools/Scripts/svn-apply
Sending        WebKitTools/Scripts/svn-unapply
Transmitting file data ...
Committed revision 37847.

http://trac.webkit.org/changeset/37847
Comment 4 Rob Buis 2020-11-08 11:04:54 PST
Reopening to attach new patch.
Comment 5 Rob Buis 2020-11-08 11:04:57 PST
Created attachment 413543 [details]
Patch
Comment 6 Rob Buis 2020-11-08 11:29:18 PST
Uploaded to wrong bug...
Comment 7 Radar WebKit Bug Importer 2020-12-01 10:21:20 PST
<rdar://problem/71856103>