[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: pre-commit hook script for making tags read only

From: Justin Johnson <justinjohnson_at_gmail.com>
Date: 2006-11-21 19:21:26 CET

On 11/21/06, Dmitri Colebatch <dim@colebatch.com> wrote:

> Hi all,
>
> I'm trying to use the script in
> http://subversion.tigris.org/servlets/ReadMsg?listName=users&msgNo=40442 but
> get an error:
>
> C:\dev\tJunction>svn commit Readme.txt -m "Token change to test svn"
> Sending Readme.txt
> Transmitting file data .svn: Commit failed (details follow):
> svn: MERGE request failed on '/tJunction/trunk'
> svn: 'pre-commit' hook failed with error output:
>
> From the debug I've done I gather that the svnlook changed command is
> failing without much explanation. I also assume that I cant debug this
> outside the commit hook due to this:
>
> [subversion@toywsda hooks]$ svnlook changed
> /home/subversion/svn_repository -t d2m
> svn: Cannot modify transaction named 'd2m' in filesystem
> '/home/subversion/svn_repository/db'
>
> Does anyone have a pre-commit script that prevents people writing to the
> tags directory? Alternatively could anyone offer any advice/suggestions on
> the above?
>
>

svnperms.py has been working well for me.

If you have a single project repository called test_repos, the following
config allows tags and branches to be created, prevents tags from being
removed or modified, and prevents branches from being removed.

[test_repos]
trunk/ = *(add)
tags/ = *(add)
branches/ = *(add)
trunk/.+ = *(add,remove,update)
tags/[^\/]+/ = *(add)
branches/[^\/]+/ = *(add)
branches/[^\/]+/.+ = *(add,remove,update)

If you make the change to svnperms.py suggested at
http://subversion.tigris.org/issues/show_bug.cgi?id=2657, the following
config does the same for a multiple project repository.

[test_repos]
[\w\d_-]+/ = *(add,remove,update)
[\w\d_-]+/trunk/ = *(add)
[\w\d_-]+/tags/ = *(add)
[\w\d_-]+/branches/ = *(add)
[\w\d_-]+/trunk/.+ = *(add,remove,update)
[\w\d_-]+/tags/[^\/]+/ = *(add)
[\w\d_-]+/branches/[^\/]+/ = *(add)
[\w\d_-]+/branches/[^\/]+/.+ = *(add)
Received on Tue Nov 21 19:22:47 2006

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.