Hi Daniel
> So on Windows I just convert patches to CRLF before I apply them. But
> this sometimes has the effect of corrupting a file that uses other line
> endings too.
I hope 'svn diff --svnpatch' and 'svn patch' can handle EOLs automatically.
I don't want to brother EOLs when using 'svn diff --svnpatch' and 'svn patch'.
Regards.
Masaru.
2008/9/22 Daniel Shahaf <d.s_at_daniel.shahaf.name>:
> masaru tsuchiyama wrote on Mon, 22 Sep 2008 at 08:55 +0900:
>> Hi.
>>
>> Thanks for the reply.
>>
>> I get GNU patch from http://gnuwin32.sourceforge.net/packages/patch.htm
>> and run "svn patch --patch-cmd=patch.exe out.txt".
>>
>> But I get the following error.
>> patching file build.conf
>> patching file www/hacking.html
>> Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354
>>
>> This application has requested the Runtime to terminate it in an unusual way.
>> Please contact the application's support team for more information.
>> svn: 'patch.exe' returned error exitcode 3
>>
>> I open the patch file with a text editor and find that the file has
>> CRs and CR-LFs.
>> Then I convert the line endings to CR-LF and re-try 'svn patch'. I can
>> successfully
>> apply the patch.
>>
>> It seems GNU patch can't handle mixed line endings and 'svn diff --svnpatch'
>> produces a mixed-line-ending result on Windows.
>>
>
> In my experience, it is LF line endings that GNU patch can't handle.
> (i.e., if you take a patch file with only LF line endings, you'll still
> get that assertion.) And, yes, the output of 'svn diff' has mixed EOLs on
> Windows.
>
> So on Windows I just convert patches to CRLF before I apply them. But
> this sometimes has the effect of corrupting a file that uses other line
> endings too. (I don't remember what happens if the file being patched
> has non-CRLF lines -- whether it asserts or works or silently converts
> those lines to CRLF.) But mixed-EOLs file is the rare case, 90% of the
> time the CRLF'd patch just works.
>
> Daniel
>
>> Regards.
>> Masaru.
>>
>> 2008/9/22 Arfrever Frehtes Taifersar Arahesis <arfrever.fta_at_gmail.com>:
>> > 2008-09-21 04:11:27 masaru tsuchiyama napisaĆ(a):
>> >> Hi.
>> >>
>> >> I tried svnpatch-diff branch on Windows XP.
>> >>
>> >> I got the followging error when patching.
>> >> ---------------------------------------------------------------------
>> >> D:\...>svn patch out.txt
>> >> patching file build.conf
>> >> patching file www/hacking.html
>> >> Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354
>> >>
>> >> This application has requested the Runtime to terminate it in an unusual way.
>> >> Please contact the application's support team for more information.
>> >> svn: No 'patch' program was found in your system. Please try
>> >> to use --patch-cmd or 'patch-cmd' run-time configuration
>> >> option or manually use an external tool to apply Unidiffs.
>> >> svn: External program is missing
>> >> ---------------------------------------------------------------------
Received on 2008-09-22 15:53:26 CEST