开发者

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 开发者_JAVA百科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.


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).


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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜