Netbeans缺少SVN添加
在过去的几天里,我一直在为这件事而发疯。我们刚刚完成 Hudson 持续集成服务器的设置。因此,它每次提交都会运行一个构建脚本来验证提交。问题在于,它验证存储库中的所有文件都将 svn:keywords = "Id"
和 svn:eol-style = "LF"
属性设置为所有 .php
文件,这通常会很棒(上次我这样做时,我使用了 Eclipse 和 Tortoise SVN,它们都有 svn::add 功能)。
但问题是我已经非常习惯 Netbeans。 Netbeans 没有我能找到的 svn add 函数(它在提交时自动添加文件)。问题是在添加文件之前我无法添加属性。如果我提交而不添加属性,构建将会失败。因此,我每次提交都会导致构建失败,因为我需要采取 5 个步骤(提交、递归 propset、提交、确认失败的构建、删除失败的构建)来完成通常只需要 2 个步骤(propset、提交)的操作。
我现在真的不想回到 Eclipse,但是当我需要 20 分钟才能提交时,因为我需要将所有事情都做 4 次,它很快就会变得陈旧......有什么解决方法吗?缺少(缺少删除属性检查,这会破坏要点,因为我无论如何都希望设置这些属性)?还是我只是SOL?...
I've been driving myself crazy over the past few days over this one. We've just finished setting up a Hudson Continuous-Integration server. So it runs a build script each and every commit to validate the commit. The issue is that it validates that all the files in the repo have both the svn:keywords = "Id"
and svn:eol-style = "LF"
properties set on all .php
files, which normally would be great (The last time I did this, I used Eclipse and Tortoise SVN, which both have svn::add functionality).
But the problem is that I've grown quite accustomed to Netbeans. And Netbeans has no svn add
function that I can find (It add files automatically upon commit). The problem is that I can't add the properties until the files are added. If I commit without adding the properties, the build will fail. So I wind up failing the build every other commit because I need to take 5 steps (commit, recursive propset, commit, acknowledge failed build, delete failed build), to do something that would normally only take 2 (propset, commit).
I don't really want to go back to Eclipse at this point, but when it takes me 20 minutes to commit because I need to do everything 4 times, it's going to get old quickly... Is there some workaround that I'm missing (Short of removing the property check, which will defeat the point, since I want those properties set anyway)? Or am I just SOL?...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Subversion 有一个
~/.subversion/config
文件,允许您自定义许多不同的设置,其中包括 auto-props,这是根据文件自动设置的属性因此,假设 Netbeans 尊重该文件,您可以通过更改
[auto-props]
部分以包含*.php = svn:eol- 来告诉 svn 自动设置这些属性style=LF;svn:keywords=Id
例如:
更新:
Netbeans 6.9 似乎读取 上的
~/.subversion/config
文件启动,并且在不重新启动的情况下不会拾取更改。重新启动 Netbeans 后,它会正确选择我选择的 auto-props 并将它们应用到每个新创建的文件。更新 2:
Netbeans 在启动时似乎会读取全局和个人 Subversion 配置文件(以及许多其他 Subversion 文件)。这是 strace 看到的相关部分:
进一步检查似乎意味着,一旦读取了配置文件,它就会写出存储在
的配置文件的副本(使用
(至少在 Linux 上)。O_TRUNC
) >~/.netbeans/6.9/config/svn/config/config基于此,我假设 Netbeans 试图足够智能,以使用您在配置文件中设置的任何 subversion 设置(全局和个人)。
Subversion has a
~/.subversion/config
file that allows you to customize a number of different settings, among which is auto-props, properties that are automatically set on files based on their extension:So, assuming Netbeans respects that file, you can tell svn to automatically set those properties by changing the
[auto-props]
section to include*.php = svn:eol-style=LF;svn:keywords=Id
For example:
UPDATE:
Netbeans 6.9 appears to read in the
~/.subversion/config
file on startup and does NOT pickup changes without a restart. After restarting Netbeans, it correctly picks up my selected auto-props and applies them to each newly created file.UPDATE 2:
Netbeans appears to read through both the global and personal subversion configuration files (among many other subversion files) when it starts up. Here's a relevant portion as seen by strace:
Further examination seems to imply that once it's read through the config files, it then writes out a copy (using
O_TRUNC
) of the configuration file which it stores at~/.netbeans/6.9/config/svn/config/config
(at least on Linux).Based on this, I assume that Netbeans is attempting to be intelligent enough to use whatever subversion settings you have set in your config files, both global and personal.