How do you store file permissions in a repository? A few files need to be read-only to stop a third party program from trashing it but after checking out of the repository t
I would recommend to generate permissions map using mtree utility (FreeBSD has it by default), store the map in the repository, and, as was mentioned above, run a script that would restore proper file permissions from the map as the first step of the build process.
SVN does have the capability of storing metadata (properties) along with a file. The properties are basically just key/value pairs, however there are some special keys like the 'svn:executable', if this property exists for a file, Subversion will set the filesystem's executable bit for that file when checking the file out. While I know this is not exactly what you are looking for it might just be enough (was for me).
There are other properties for line ending (svn:eol-style) and mime type(svn:mime-type).
Graham, svn
doesn't store permissions. Your only option is to wrap your call to svn
in a script. The script should call svn
with its arguments, then set the permissions afterward. Depending on your environment, you might need to call your script svn
and tweak your PATH
to ensure it gets called.
I quite like morechilli's idea to have the list of files and permissions checked into the repository itself.
One possible solution would be to write a script that you check in with the rest of your code and which is run as the first step of your build process.
This script runs through your copy of the codebase and sets read permissions on certain files.
Ideally the script would read the list of files from a simple input file. This would make it easy to maintain and easy for other developers to understand which files get marked as read-only.
Consider using svn lock to disallow others from writing to the file.
We created a batch file to do this for us. Would prefer actual support in subversion though...