You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Reinhard Brandstädter <re...@jku.at> on 2007/06/28 07:41:08 UTC

Locking a whole repository

Hello,

Is it possible to administratively lock a whole repository for any access?
There are times where I want to completely lock-down a repository for people's 
access. A possible way could pe changing the permissions or removing the 
apache configuration but this is a bit too complex.
What I had in mind was creating a "lock" file in the repository's directory so 
that only svnadmin commands work (e.g. dump and load) and when this lock file 
is removed people can access it again.

Reinhard

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Locking a whole repository

Posted by Marko Kaening <mk...@mch.osram.de>.
Hi,

this question came up some time ago, or comes up regularily. I just send 
a piece from an answer given by Ben Collins-Sussman <su...@collab.net> 
a while ago:

--- snip ---


> If so is it possible to create a repository that will only allow locked
> access (i.e. you checkout with a lock or you don't check out at all)?

Yes, you can certainly write a pre-commit hook script to enforce this.  
The
script would examine all of the paths someone is attempting to commit, and
make sure that every one of them is locked...

Have you read the documentation on svn locking yet?

  http://svnbook.red-bean.com/nightly/en/svn.advanced.locking.html

The recommended procedure is to specifically mark un-mergeable files as
"needing a lock".  This causes the files to have read-only permission in
everyone's private sandboxes.  When you lock the file, it becomes
read-write.

--- snip ---

Hope that helps,
Marko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Locking a whole repository

Posted by Blair Zajac <bl...@orcaware.com>.
Reinhard Brandstädter wrote:
> Hello,
> 
> Is it possible to administratively lock a whole repository for any access?
> There are times where I want to completely lock-down a repository for people's 
> access. A possible way could pe changing the permissions or removing the 
> apache configuration but this is a bit too complex.
> What I had in mind was creating a "lock" file in the repository's directory so 
> that only svnadmin commands work (e.g. dump and load) and when this lock file 
> is removed people can access it again.
> 
> Reinhard

If you want to still allow read-only access, you can copy /bin/false into an 
unused pre-commit or start-commit script, or if you have both, just add an 'exit 
1' to the top.  If you want to disable all access, just move the top repository 
directory.

Regards,
Blair

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org