简体   繁体   English

停止Eclipse / Subversive在初始提交时将svn:mime-type设置为text / plain

[英]Stop Eclipse/Subversive from setting svn:mime-type to text/plain on initial commit

How do I stop Subversive from setting svn:mime-type to text/plain on initial commit? 如何阻止Subversive在初始提交时将svn:mime-type设置为text/plain

My Java code is being checked into my repository with the svn:mime-type property set as text/plain , and as a result my web-based SVN viewer (trac) isn't syntax highlighting. 正在将我的Java代码检入我的存储库,并将svn:mime-type属性设置为text/plain ,因此我的基于Web的SVN查看器(trac)不是语法高亮显示。

I should add I'm running Eclipse 3.5 and the most recent version of Subversive with the SVNKit 1.3.0 (for SVN 1.6) adapter. 我应该添加我正在使用SVNKit 1.3.0(适用于SVN 1.6)适配器运行Eclipse 3.5和最新版本的Subversive。


For those finding this question, this issue no longer exists as it was resolved through an option in the preferences section of Subversive. 对于那些发现这个问题的人来说,这个问题不再存在,因为它是通过Subversive的首选项部分中的选项解决的。

You'll need to actually setup the mime types yourself in "Window > Preferences> Team > SVN > Properties Configuration > Automatic Properties" 你需要在“Window> Preferences> Team> SVN> Properties Configuration> Automatic Properties”中自己设置mime类型。

For file type *.java for example, set it to: svn:mime-type=text/x-java 例如,对于文件类型* .java,将其设置为:svn:mime-type = text / x-java

If your project already got messed by subversive, cd to project root and run the following commands 如果您的项目已经被颠覆性搞砸了,请cd到项目根目录并运行以下命令

find . -name "*.java" -exec svn propset svn:mime-type 'text/x-java' {} \;
find . -name "*.xml" -exec svn propset svn:mime-type 'text/xml' {} \;

By default, Subversion only sets svn:mime-type to application/octet-stream when the file is binary (and you didn't explictly assign any other value). 默认情况下,Subversion仅在文件为二进制文件时将svn:mime-type设置application / octet-stream (并且您没有明确指定任何其他值)。 See Automatic Property Setting for reference. 请参阅自动属性设置以供参考。 So this feature is courtesy of Subversive. 所以这个功能是Subversive的礼貌。

I'm afraid I'm not a Subversive user, but I found in Google a reference to a menu in "Window > Preferences> Team > SVN > Properties Configuration > Automatic Properties" where it seems you can remove unwanted associations. 我担心我不是颠覆用户,但我在Google中找到了对“窗口>首选项>团队> SVN>属性配置>自动属性”中菜单的引用,您似乎可以删除不需要的关联。

We just ran into this as well. 我们也遇到了这个问题。 FYI all, I've posted https://bugs.eclipse.org/bugs/show_bug.cgi?id=322772 仅供参考,我发布了https://bugs.eclipse.org/bugs/show_bug.cgi?id=322772

The reported bug by vorburger ( https://bugs.eclipse.org/bugs/show_bug.cgi?id=322772 ) has been fixed. vorburger报告的错误( https://bugs.eclipse.org/bugs/show_bug.cgi?id=322772 )已得到修复。 There is an option called 'Set text MIME type for all non-binary files' under "Window > Preferences> Team > SVN > Properties Configuration > Automatic Properties" which needs to be unchecked to prevent Subversive to add the S/MIME-Type to newly added resources. “Window> Preferences> Team> SVN> Properties Configuration> Automatic Properties”下有一个名为“为所有非二进制文件设置文本MIME类型”的选项,需要取消选中该选项以防止Subversive将S / MIME-Type添加到新增资源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM