svn propset svn:executable script_that_does_something.py
... to teach Subversion that
script_that_does_something.py
should be executable.(If you ask for
svn propset --help
Subversion will tell you that there are two different command forms of propset
. But the one given here is usually the one we want.)The benefit here is that future check-outs of the repository that contains
script_that_does_something.py
will have the executability permission bits set on the file from the moment it is checked out. This means that you'll be able to check out and then execute the script immediately afterwards without having to first chmod 755
the script.Interesting potential side-effect of using
svn:executable
is that you may occasionally find a non-executable file listed as executable in the output of ls -l
:
$ ls -l
total 29056
-rwxr-xr-x 1 foo foo 1473 Jun 17 10:52 simple-text-file.rtf
Two things could be going on here.
It could be that you manually set
simple-text-file.rtf
to executable with a call to chmod 755 simple-text-file.rtf
or equivalent at some point. If that's the case then chmod 644 simple-text-file.rtf
will unset the executability bits on the file.Alternatively, it could be that the
svn:executable
property is set on simple-text-file.rtf
in the repository that houses the file. If that's the case then chmod 644 simple-text-file.rtf
will not do what you think. The command will instead set simple-text-file.rtf
to nonexecutable only until the next check-in. After next check-in simple-text-file.rtf
will again be marked as executable. The reason for this is that changing permissions on your local copy of the file does nothing to remove the svn:executable
property from the copy of the file in the repository. The solution here is to remove svn:executable
with svn propdel svn:executable simple-text-file.rtf
.
No comments:
Post a Comment