In SVN, is there a way to disable commits of changes made to file that exists locally as an external?
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. 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).
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
. The externals are under the directory common
under these projects:
[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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.