1

I'm pretty new to SVN and it's been driving me crazy! Here's the basic problem:

I've working on a site that allows users to upload source code. In a subdirectory called "submissions" all the uploads are stored. While the webserver has write permission to the submissions, I do not. I'm using SVN for version control on my php and text files, but it keeps getting locked. If possible, I'd like SVN to keep an archive of uploaded submissions, and I don't mind it being unable to revert them due to file permissions.

The problem is SVN keeps locking, it tells me to cleanup, cleanup tells me that "submissions" isn't a working copy directory and I'm not allowed to commit changes, remove files or do anything else in my normal workflow. Any suggestions?

[mark@srv-web1 ~]$ svn commit -m "added report"
svn: Working copy '/var/www/sites/testPortal' locked
svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
[mark@srv-web1 ~]$ svn cleanup
svn: 'submissions' is not a working copy directory
[mark@srv-web1 ~]$ svn remove submissions
svn: Working copy '.' locked
svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
[mark@srv-web1 ~]$ ls -la submissions
total 32
drwxrwxrwx  7 nginx nginx 4096 Aug  4 03:22 .
drwxrwxrwx 10 root  root  4096 Aug  5 01:36 ..
drwxr-xr-x  2 nginx nginx 4096 Aug  4 00:04 114
drwxr-xr-x  2 nginx nginx 4096 Aug  4 02:10 116
drwxr-xr-x  2 nginx nginx 4096 Aug  4 02:40 117
drwxr-xr-x  2 nginx nginx 4096 Aug  4 02:15 118
drwxr-xr-x  2 nginx nginx 4096 Aug  4 03:22 119
-rw-r--r--  1 nginx nginx    1 Aug  4 01:51 uploads.txt
Mark Wilbur
  • 2,809
  • 2
  • 23
  • 22

2 Answers2

2

Probably the simplest is to chgrp all those files to a group you are in, then change the permissions to give yourself write access (g+w). Use permission 2775 for the directory, it will add the group sticky bit, so all files created in that directory will have the group of the directory - even if the creator (nginx in this case) is not in that group.

Ariel
  • 25,995
  • 5
  • 59
  • 69
  • I don't have permission to change their group or or permissions – Mark Wilbur Aug 05 '11 at 06:35
  • +1 You explained that in a simple way. Many people have a hard time grasping this concept at first, and your explanation nails it well. – Stephane Gosselin Aug 05 '11 at 06:49
  • @mark-wilbur You probably do actually, except you have to do it via the webserver. Run some PHP code, or whatever you use, and do the changing there. You might need only to own the .svn directory. If so then, first have webserver change the root directory to 777, then create a .svn owned by you, then change the root directory back. Once .svn is writable subversion should be OK. You will however need a .svn in every directory, not just the root. – Ariel Aug 05 '11 at 07:03
1

If the problem is that you want some files to be out of version control,you simply could set the svn:ignore property in the directory holding the directory you want.

You could also check this insightful SO question, has a lot of good points that seem somewhat related to your problem.

Community
  • 1
  • 1
Stephane Gosselin
  • 9,030
  • 5
  • 42
  • 65
  • That's a good thing to know. If understand it correctly, though, svn would no longer be archiving the submissions. Is there a way to tell svn to be read-only on a directory? – Mark Wilbur Aug 05 '11 at 06:39
  • well, depending on the server set-up, maybe so. Depending on the svn *serverside* configuration, svn uses a user based approach, so a user can be created and given read-only access if that is what you are after. Read the free svn book it is an easy read, totally worth it if you use svn at all. – Stephane Gosselin Aug 05 '11 at 06:42