Search code examples
svnpermissionsfile-permissionsdirectory

Make a folder in SVN writable so that when the repo is checked out, the permissions are already set to writable?


I'm not a Subversion pro by any means. But I am using it for my coding projects and using the deployment feature at springloops.com (love it).

I have some log, cache and image folders that I routinely need to make writable on new deployments or new projects. Is there a way to make it so that when deploying or downloading, the folder permissions will already be set to 0777?


Solution

  • Unfortunately, Subversion doesn't support storing permissions. According to this discussion (Nabble "Unix file permissions" (external link)), however, one can use svn properties and a little bit of shell scripting.

    To store the properties in subversion:

    $ svn propset owner username aFile 
    $ svn propset group groupname aFile 
    $ svn propset mode filemode aFile
    

    To later re-apply the file permissions:

    $ chown `svn propget owner aFile`.`svn propget group aFile` aFile
    $ chmod `svn propget mode aFile` aFile