[英]SVN disallowing editing via externals
在SVN中,是否有一种方法可以禁止提交对作为外部文件本地存在的文件的更改?
我想强迫我的用户签出实际文件,进行更改,然后提交。 然后,他们可以测试该文件的每个已知订阅项目,以确保它们没有破坏某些内容。
并不是的。 我有一个可能有用的预提交钩 。
不幸的是,当您编辑外部目录时, svnlook
没有办法区分它是否是外部目录。 我相信早期版本的SVN不允许您直接编辑外部对象,因为我记得这似乎是默认行为(我在这里谈论的是1.2和1.3)。
但是,您可以使用此钩子来防止用户在看起来像外部文件的目录下编辑文件。
假设您有一个项目http://svn.vegicorp.com/repo/trunk/common
,该项目已在http://svn.vegicorp.com/repo/trunk/foomaster
和http://svn.vegicorp.com/repo/trunk/barmaster
。 外部对象在这些项目下的common
目录下:
[file You cannot edit an external directory. Please checkout http://svn.vegicorp.com/repo/trunk/common to edit that file]
file = /trunk/*/common
access = read-only
users = @ALL
[file You cannot edit an external directory. Please checkout http://svn.vegicorp.com/repo/trunk/common to edit that file]
file = /branches/*/*/common
access = read-only
users = @ALL
[file Good for you! You checked out http://svn.vegicorp.com/repo/trunk/common ]
file = /trunk/common/**
access = read-write
users = @ALL
[file Good for you! You checked out http://svn.vegicorp.com/repo/trunk/common ]
file = /branches/*/common/**
access = read-write
users = @ALL
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.