Netbeans缺少SVN添加

发布于 2024-09-12 22:28:08 字数 593 浏览 3 评论 0原文

在过去的几天里,我一直在为这件事而发疯。我们刚刚完成 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

迷迭香的记忆 2024-09-19 22:28:08

Subversion 有一个 ~/.subversion/config 文件,允许您自定义许多不同的设置,其中包括 auto-props,这是根据文件自动设置的属性因此

,假设 Netbeans 尊重该文件,您可以通过更改 [auto-props] 部分以包含 *.php = svn:eol- 来告诉 svn 自动设置这些属性style=LF;svn:keywords=Id

例如:

[auto-props]
# here's yours
*.php = svn:eol-style=LF;svn:keywords=Id
# and one with multiple keywords
*.c = svn:eol-style=native;svn:keywords=Author Date Rev Id HeadURL
# and one with a mime-type
*.png = svn:mime-type=image/png

更新

Netbeans 6.9 似乎读取 上的 ~/.subversion/config 文件启动,并且在不重新启动的情况下不会拾取更改。重新启动 Netbeans 后,它会正确选择我选择的 auto-props 并将它们应用到每个新创建的文件。

更新 2

Netbeans 在启动时似乎会读取全局和个人 Subversion 配置文件(以及许多其他 Subversion 文件)。这是 strace 看到的相关部分:

stat("/home/kibab/.subversion/config", {st_mode=S_IFREG|0644, st_size=4576, ...}) = 0
open("/home/kibab/.subversion/config", O_RDONLY) = 28
open("/etc/subversion/config", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/home/kibab/.netbeans/6.9/config/svn/config/config", {st_mode=S_IFREG|0644, st_size=825, ...}) = 0
stat("/home/kibab/.netbeans/6.9/config/svn/config", {st_mode=S_IFDIR|0755, st_size=61, ...}) = 0
open("/home/kibab/.netbeans/6.9/config/svn/config/config", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 28

进一步检查似乎意味着,一旦读取了配置文件,它就会写出存储在 的配置文件的副本(使用 O_TRUNC) >~/.netbeans/6.9/config/svn/config/config (至少在 Linux 上)。

基于此,我假设 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:

[auto-props]
# here's yours
*.php = svn:eol-style=LF;svn:keywords=Id
# and one with multiple keywords
*.c = svn:eol-style=native;svn:keywords=Author Date Rev Id HeadURL
# and one with a mime-type
*.png = svn:mime-type=image/png

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:

stat("/home/kibab/.subversion/config", {st_mode=S_IFREG|0644, st_size=4576, ...}) = 0
open("/home/kibab/.subversion/config", O_RDONLY) = 28
open("/etc/subversion/config", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/home/kibab/.netbeans/6.9/config/svn/config/config", {st_mode=S_IFREG|0644, st_size=825, ...}) = 0
stat("/home/kibab/.netbeans/6.9/config/svn/config", {st_mode=S_IFDIR|0755, st_size=61, ...}) = 0
open("/home/kibab/.netbeans/6.9/config/svn/config/config", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 28

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文