简体   繁体   English

SVN不允许通过外部进行编辑

[英]SVN disallowing editing via externals

In SVN, is there a way to disable commits of changes made to file that exists locally as an external? 在SVN中,是否有一种方法可以禁止提交对作为外部文件本地存在的文件的更改?

I want to force my users to checkout the actual file, make changes, and commit there. 我想强迫我的用户签出实际文件,进行更改,然后提交。 Then they can test each of the known subscribed projects of that file to make sure they didn't break something. 然后,他们可以测试该文件的每个已知订阅项目,以确保它们没有破坏某些内容。

Not really. 并不是的。 I have a Precommit Hook that may work. 我有一个可能有用的预提交钩

Unfortunately, when you edit an external directory, svnlook doesn't have a way to distinguish whether or not it's an external. 不幸的是,当您编辑外部目录时, svnlook没有办法区分它是否是外部目录。 I believe earlier versions of SVN didn't let you directly edit externals because I remember that seemed to be the default behavior (I'm talking about 1.2 and 1.3 here). 我相信早期版本的SVN不允许您直接编辑外部对象,因为我记得这似乎是默认行为(我在这里谈论的是1.2和1.3)。

However, you could use this hook to prevent users from editing files under directories that look like externals. 但是,您可以使用此钩子来防止用户在看起来像外部文件的目录下编辑文件。

Assume that you have a project http://svn.vegicorp.com/repo/trunk/common that's used in http://svn.vegicorp.com/repo/trunk/foomaster and http://svn.vegicorp.com/repo/trunk/barmaster . 假设您有一个项目http://svn.vegicorp.com/repo/trunk/common ,该项目已在http://svn.vegicorp.com/repo/trunk/foomasterhttp://svn.vegicorp.com/repo/trunk/barmaster The externals are under the directory common under these projects: 外部对象在这些项目下的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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM