簡體   English   中英

SVN不允許通過外部進行編輯

[英]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/foomasterhttp://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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM