views:

5284

answers:

8

When I run "svn propedit svn:ignore ." at the root of my svn repository, I get this error: svn: Inconsistent line ending style

I have tried to run this script: http://blog.eflow.org/archives/130 which runs dos2unix and sets the eol-style on all of the files, however this problem still persists. Any idea what could be wrong?

A: 

Did the script definitely touch each and every text file (assuming you do have dos2unix installed, otherwise that'd be why...)?

The other things I can think of is to check that all files have their mime-type set correctly (you don't have a binary file that's somehow marked as a text file checked in, perchance?).

That said, if you are in a multi-OS environment I consider it not a good idea to set svn:eol-style to CRLF as described in the blog post above if you are sharing and editing text files between OSs. Because if you do it that way, the files that look OK in Windows are littered with control characters in Unix. Better to use 'native' as the EOL style.

Timo Geusch
Timo, I'm quite sure the script touched every text file and I actually did change the script to "native" before running it. Also, I don't have any problems while checking things in, only while running the propedit command. Does that say anything?
Kelvin
A: 

If you get it while doing the propedit, then it seems to me more that SVN is complaining about the format of the text file you're using for the properties!

Which OS are you on? Which editor are you using to propedit? If the propedit command still fires up an editor, I would use this editor to check which line endings are in there (vi does this IIRC).

ShiDoiSi
+4  A: 

Subversion is not complaining about the content of any file, but about the content of the svn:ignore property. One way to fix this is to simply delete the svn:ignore property with svn propdel and then recreate it.

Another way which may be easier if you have a lot of lines in your svn:ignore:

  1. fetch the value of svn:ignore in a temporary file like this:

    svn propget svn:ignore . > temp

  2. fix the line endings in the temp file
  3. set the value of svn:ignore from the fixed file like this:

    svn propset svn:ignore -F temp .

Wim Coenen
I ended up having to use svn propdel and just recreate the property. When I tried your 2nd suggestion (propget > temp), I got the same message as I was getting with propedit. Thanks!
Kelvin
+1  A: 

I got this error, but it ended up being a file missing the last End-of-lie( incomplete last line).

Correcting this by opening the file in VI and saving it solved it.

Geir Engebakekn
A: 

Handy tool for Windows users

Integrates with shell and can handle multiple files at once (ctrl + select file)

Artur Gajowy
+1  A: 

My problem was that I was getting this in Visual Studio.NET. To fix it, I copied all the text of the file into notepad and saved it from Notepad to "xxx.aspx" or whatever the proper file name is. Then in Visual Studio, I was prompted to reload a changed file, and voila - a dialog box asking me if I would like to normalize my line endings. Problem solved.

Amos Van Horn
A: 

vi didn't show me the bad line so i removed the end of lines from the comment section, readded them (up to END) and saved the file. it worked after that.

NOTE: backup you revprop file before tweaking it. if you turf it, no going back

Isaac
A: 

Running

unix2dos [file]

via cygwin fixed this for me.

gollumullog