[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Now 100% Serious Newline conversion suggestion

From: Julian Fitzell <julian_at_beta4.com>
Date: 2001-12-14 18:30:38 CET

Mark Benedetto King wrote:

>>My nice cross-platform perl script that used to do
>>
>> checkout("foo");
>> process("foo");
>>
>>becomes
>>
>> checkout("foo");
>> $foo_ending = get_line_ending_attribute("foo");
>> $platform_ending = get_platform_line_ending();
>> if ($foo_ending == CRLF && $platform_ending == LF) {
>> dos_to_unix("foo");
>> } else if ($foo_ending == LF && $platform_ending == CRLF) {
>> unix_to_dos("foo");
>> if ($foo_ending == CR && $platform_ending == LF) {
>> mac_to_unix("foo");
>> } else if ($foo_ending == LF && $platform_ending == CR) {
>> unix_to_mac("foo");
>> if ($foo_ending == CR && $platform_ending == CRLF) {
>> mac_to_dos("foo");
>> } else if ($foo_ending == CRLF && $platform_ending == CR) {
>> unix_to_mac("foo");
>> }
>> process("foo");
>>
>>No thanks.
>>
>>Peter.
>>
>>
>>
>
> consider:
>
> checkout("foo");
> $foo_ending = get_line_ending_attribute("foo");
> $platform_ending = get_platform_line_ending();
> fix_endings( "foo", $foo_ending, $platform_ending );
>
> --ben

Or:

        checkout("foo");

Presumably checkout() can be written to fix the line endings when
necessary? Or certainly a method which can do both and be called once...

Not advocating this proposal particularly (in fact I want newline
conversion) but I don't think having to write a little conversion code
is the end of the world.

Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:53 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.