Index: tools/hook-scripts/svnperms.py =================================================================== --- tools/hook-scripts/svnperms.py (revision 999888) +++ tools/hook-scripts/svnperms.py (working copy) @@ -227,6 +227,7 @@ def check_perms(filename, section, repos, txn=None, rev=None, author=None): svnlook = SVNLook(repos, txn=txn, rev=rev) + found_repo_block = 0 if author is None: author = svnlook.author() changes = svnlook.changed() @@ -234,8 +235,19 @@ config = Config(filename) except IOError: raise Error("can't read config file "+filename) + if not section in config.sections(): - raise Error("section '%s' not found in config file" % section) + # loop until there is a group/repo entry in the svnperms.conf file + for rsection in config.sections(): + matchobj = re.match(rsection, section, re.I) + if matchobj: + section = rsection + found_repo_block = 1 + break + if found_repo_block == 0: + raise Error("section '%s' not found in config file" \ + % section) + perm = Permission() perm.parse_groups(config.walk("groups")) perm.parse_groups(config.walk(section+" groups")) Index: tools/hook-scripts/svnperms.conf.example =================================================================== --- tools/hook-scripts/svnperms.conf.example (revision 999888) +++ tools/hook-scripts/svnperms.conf.example (working copy) @@ -94,3 +94,9 @@ [example5 extends example2] releases/[^/]+/ = *(add) +#Regex based repo blocks. Order of blocks should be most relevant +#to least relevant(So Author .* after all repo specific regexes.) +[.*] +trunk/.* = user8(add,update) +tags/[^/]+/ = @group1(add) +branches/[^/]+/.* = *(add,remove,update)