Newline problems with Subversion

当一个文件在*nix和Windows下多次操作后,可能混合了2种断行格式,在导入包含此种文件的项目时,常出现以下错误:File ‘/home/pal/workspace/proobox/build.xml’ has inconsistent newlines,解决的办法就是去掉相关文件的svn:eol-style : native属性,也可以直接修改svn的客户端配置文件,修改全局属性,以便提交新文件时也能不受此问题影响。

(即修改[auto-props]内相应内容,去掉svn:eol-style : native的设置)

右键选择 tortoisesvn 的设置:

然后选择 EDIT

添加下面的内容:[code][auto-props]

The format of the entries is:

file-name-pattern = propname[=value][;propname[=value]…]

The file-name-pattern can contain wildcards (such as ‘*’ and

‘?’). All entries which match will be applied to the file.

Note that auto-props functionality must be enabled, which

is typically done by setting the ‘enable-auto-props’ option.

*.c = svn:eol-style=native
*.cpp = svn:eol-style=native
*.h = svn:eol-style=native
*.dsp = svn:eol-style=native
*.dsw = svn:eol-style=native
*.sh = svn:eol-style=native;svn:executable
*.bat = svn:eol-style=native;svn:executable
*.txt = svn:eol-style=native
*.png = svn:mime-type=image/png
*.jpg = svn:mime-type=image/jpeg
*.gif = svn:mime-type=image/gif
*.java = svn:eol-style=native
*.xml = svn:eol-style=native
*.xsl = svn:eol-style=native
*.xsd = svn:eol-style=native
*.html = svn:eol-style=native
*.jsp = svn:eol-style=native
*.properties = svn:eol-style=native
Makefile = svn:eol-style=native
README = svn:eol-style=native[/code]

配置的情况如下,经过这样的修改,应该能解决这个问题。