添加 svn:executable 的正确方法

发布于 2024-11-03 01:40:04 字数 575 浏览 1 评论 0原文

我有一些文件在 svn 添加之前已经可执行。他们设置了 svn:executable 属性。现在,其他一些文件在没有可执行位的情况下签入了,我想设置 svn:executable 属性:

$ svn propset svn:executable on *.cgi

然后我检查状态,甚至带有 svn:executable 的文件也被修改了:

$ svn diff
Property changes on: a.cgi
___________________________________________________________________
Modified: svn:executable
   - 
   + *


Property changes on: b.cgi
___________________________________________________________________
Added: svn:executable
   + *

a.cgi不应修改。我想添加 svn:executable 位,其设置方式与其他文件相同,但无法找出执行此操作的命令。

I have a few files that have been executable before svn adding them. They have the svn:executable property set. Now, a few other files were checked in without the executable bit do not have it, and I want to set the svn:executable property:

$ svn propset svn:executable on *.cgi

Then I check the status and even the files with the svn:executable have been modified:

$ svn diff
Property changes on: a.cgi
___________________________________________________________________
Modified: svn:executable
   - 
   + *


Property changes on: b.cgi
___________________________________________________________________
Added: svn:executable
   + *

a.cgi should not be modified. I want to add the svn:executable bit to be set in the same way as it is on the other files, but can't figure out the command to do it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

仅此而已 2024-11-10 01:40:04

您使用 svn 属性编辑命令是正确的。该属性是 svn:executable。

在 svn 中添加“可执行位”

svn propset svn:executable on <list of files>

删除 svn 中的“可执行位”

svn propdel svn:executable <list of files>

有关此内容的 SVN 文档位于此处。

只要不修改可执行文件,您就不会修改可执行文件(校验和将验证这一点),但您正在修改 SVN存储库。请记住,SVN 修改的是文件系统,而不仅仅是文件;因此,权限位的修改将增加 SVN 修订号,即使它只是文件属性的修改(而不是文件本身的修改)。

You are right to use the svn property editing commands. The property is svn:executable.

To add the "executable bit" in svn

svn propset svn:executable on <list of files>

To remove the "executable bit" in svn

svn propdel svn:executable <list of files>

The SVN documentation for this is located here.

As far as not modifying the executables, you are not modifying the executable (a checksum will verify that), but you are modifying the SVN repository. Remember that SVN revisions file systems, not just files; so, a modification of the permission bits will increase the SVN revision number, even if it's just a modification of a file's properties (and not a modification of the file itself).

驱逐舰岛风号 2024-11-10 01:40:04

以下是我如何在项目中设置了执行位的所有 *.py 文件上设置可执行属性。
我从顶级目录执行此操作

for f in `find ./ -name '*.py'`; do echo $f; if [ -x $f ]; then echo $f 'is executable setting svn:executable'; svn propset svn:executable on $f; else echo $f 'is not executable'; fi; done;

Here is how I set the executable property on all the *.py files in my project that have execute bit set on them.
I execute this from the top level directory

for f in `find ./ -name '*.py'`; do echo $f; if [ -x $f ]; then echo $f 'is executable setting svn:executable'; svn propset svn:executable on $f; else echo $f 'is not executable'; fi; done;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文