views:

26

answers:

3

Some users are committing svn deletes by mistake, and I would like to restrict these accidental deletes, while retaining read/write permissions. Of course, they could overwrite files with zeros, but that doesn't accidentally. I did some googling and found there was a python file that claimed to do this, but as svn has changed sites, the file is lost. Is there anyone who has that file, or have any other way to add a delete permission?

A: 

No, I'm afraid not. SVN will only grant read/write permission, where writing subsumes deleting.

aefxx
+2  A: 

First thing's first: do you understand that nothing is actually deleted from the repository? You can always restore any version of a file, let alone restore "deleted" ones.

You can try implementing this with a pre-commit hook. See this.

Anton Gogolev
thanks a lot for the method
TiansHUo
+2  A: 
Michael Hackner
well, I have solved this by doing making a perl script to set permissions by looking up parameters from `svnlook` 1. deleting is not allowed for some important folders, such as `trunk` `branch` for most users 2. a passphrase such as "iamreallysureiwanttodelete" should be in the comment and then deleting is allowed, for the remaining foldersyou could say that the root of the problem are ignorant users, but I would really like to warn them when they are committing, say: "if you are going to do that, you should better be clear what you are doing"
TiansHUo