You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Vijay Dhingra <dh...@yahoo.com> on 2010/01/20 06:53:33 UTC

svnperms.py, svnperms.conf with pre-commit hook issue

Hello,

Can someone help to set svnperms.py and svnperms.conf file along with pre-commit hook to make it restricted for tags to be created only. No one can remove or update tags portion.

We have one repository for every projects i.e.

project1
     trunk
     tags
     branches

So I would like my every repository tags area to be set that tags can only be created. However it doesn't seem to be working for me.

Here is what I defined in my pre-commit hook and svnperms.conf file. If I don't include svnperms.py it works fine or if pre-commit is empty with only these below line, still it works.

   #!/bin/sh
   exit 0

pre-commit :

REPOS="$1"
TXN="$2"

# Make sure that the log message contains some text.
SVNLOOK=/usr/local/bin/svnlook
$SVNLOOK log -t "$TXN" "$REPOS" | \
   grep "[a-zA-Z0-9]" > /dev/null || exit 1

/usr/local/svn/scripts/svnperms.py -r $REPOS -t $TXN -f /svn/project1/conf/svnperms.conf || exit 1
# All checks passed, so allow the commit.
exit 0

svnperms.conf:

In svnperms.conf file I used various options but still unable to make it work:

option 1
[project1]
([^/]+)/trunk/[^/]+/ = *(add,remove,update)
([^/]+)/tags/.+ = *(add)
([^/]+)/branches/[^/]+/ = *(add,remove,update)

option 2
[project1]
trunk/.* = *(add,remove,update)
tags/[^/+]/ = *(add)
branches/[^/]+/.* = *(add,remove,update)

option 3
[project]
trunk/.+ = *(add,remove,update)
tags/.+ = *(add)
branches/.+ = *(add,remove,update)

option 4
trunk/[^/]+/ = *(add,remove,update)
tags/[^/]+/ = *(add)
branches/[^/]+/ = *(add,remove,update)


I would appreciate if someone can help me with this setup.

Regards,
Vijay