Proper way to add 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.

105445 次浏览

您可以正确地使用 svn 属性编辑命令。

在 svn 中添加“可执行位”

svn propset svn:executable on <list of files>

删除 svn 中的“可执行位”

svn propdel svn:executable <list of files>

SVN 文档位于这里。

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

Here is how I set the executable property on all the *.py files in my project that have execute bit set on them. 我从顶级目录执行此操作

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;