How to control changes to tags in SVN server on Windows

自作多情 提交于 2019-12-24 05:55:02

问题


We use VisualSVN Server 2.5.6 on Windows (important!).

Most of our SVN repositories have the standard structure:

/trunk
/branches
/tags

We want:

  • allow people to create new tags
  • forbid them to modify existing tags

Don't ask... sometimes they really try to Commit a change to existing tag ))

I found a really nice pre-commit hook - svnperms.py from standard hook scripts

Example 2 from the configuration file is probably what I need:

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

Really powerful and concise!

But it doesn't work properly on Windows - fails with error message:

D:\Repositories\Ivan_dev\hooks>svnperms.py -r D:\Repositories\Ivan_dev -s default_permissions_configuration -R 8
svnlook author D:\Repositories\Ivan_dev -r 8
'{' is not recognized as an internal or external command,
operable program or batch file.error: command failed: svnlook author D:\Repositories\Ivan_dev -r 8
'{' is not recognized as an internal or external command,
operable program or batch file.

As far as I understood it fails because of the way it's designed in Python:

The commands module, which svnperms.py uses to run underlying svnlook commands, only works on Unix.

from here: http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=72052

I really like the approach of svnperms.py to allow you controlling add, remove and modify actions (in line with A, D and M types of changes in SVN) instead of just Read and Write in authz module.

Plus it gives unlimited power because of regular expressions used to specify path.

Are there similar SVN hooks scripts that work on Windows?

I don't know Python unfortunately, but quite experienced in Perl. So even thinking about rewriting svnperms.py into Perl... but this will take a few hours, plus testing...

来源:https://stackoverflow.com/questions/15412685/how-to-control-changes-to-tags-in-svn-server-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!