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

Re: 1.4.[23] for cygwin doesn't handle eol's properly

From: Kylo Ginsberg <kylo.ginsberg_at_gmail.com>
Date: 2007-02-28 00:05:26 CET

On 2/27/07, Nathan Kidd <nathan-svn@spicycrypto.ca> wrote:
> Kylo Ginsberg wrote:
> > I am running Cygwin with DOS as the default text file type when I see
> > this problem. (I thought that was implied by specifying that it is a
> > textmode cygwin mount?) Hope that clarifies.
>
> I don't think textmode implies anything. If you set DOS mode then
> textmode will produce CRLF, if you set UNIX mode then textmode will give
> you LF.

I am not a cygwin expert, but this does not match the behavior on my
cygwin installation. What I see is:

Changing to DOS mode sets the default cygwin mounts to "textmode" and
changing to UNIX mode sets the default cygwin mounts to "binmode".
Independently, you can specify additional mounts in the mode of choice
(textmode/binmode).

On a textmode mount "echo foo > foo" produces a 5 character file
ending 0d 0a. This is true regardless of the DOS vs UNIX setting in
setup.

On a binmode mount "echo foo > foo" produces a 4 character file ending
0a. This is true regardless of the DOS vs UNIX setting in setup.

From all this I tentatively conclude that the DOS vs UNIX setting
*only* sets the mount types for the default mounts. At least I
haven't confirmed that it does anything else.

> Are you saying the following is true?

Originally, I was checking out a file previously checked in with
svn:eol-style set to native and seeing LF line endings.

But I tried your should-be-simple experiment:

>
> echo -e "line 1\nline2\n" > test.txt # test.txt has CRLF
> svn add test.txt
> svn ps svn:eol-type=native test.txt

I replaced this with:
svn ps svn:eol-style native test.txt

> svn ci -m"test" test.txt

And at commit time, I get:
svn: Can't parse [...].svn/tmp/props/test.txt.svn-work
svn: Malformed file

I tried hand-editing the CRs out of this file but still had this
problem with the commit (and so couldn't carry out the test). This
problem is a new one.

> rm test.txt
> svn up test.txt # now test.txt has LF
>
> In that case I suppose it would be an issue with APR deciding that
> APR_EOL_STR will be "\n" instead of "\r\n".

So I took at look in the source at subversion/libsvn_subr/subst.c, and
I see that the eol string for native is set to APR_EOL_STR. And sure
enough APR_EOL_STR is defined as "\n" for this build.

So I edited APR_EOL_STR to "\r\n" and rebuilt. This gives me the
desired behavior for the original issue (checkout of files with
svn:eol-style set to native now checkout with CRLF line endings), but
I still can't commit a file with a property set (i.e. I get the
"Malformed file" error message).

At this point, the best workaround I have for this mess is to use the
windows-compiled subversion under cygwin, which appears to work for
cygwin textmode mounts. It doesn't know about cygwin paths of course,
but fortunately it parses forward slashes as back slashes so it works
in most practical settings.

Any other suggestions? Or successful experience with subversion in
the cygwin environment?

Thanks
Kylo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Feb 28 00:05:55 2007

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

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