How can I be automatically notified if a particular file(s) in svn is altered?
In my current project we have directory with all of our third party (jQuery, dataTables, etc...) javascript files in it. A few times now we have had some developers alter these files thinking that is the only way to accomplish their tasks (they were mistaken but didn't have the experience to know it) and this has led to extra time having to be spent cleaning up.
Is there a way to "put a watch" on certain files in subversion so that we would be notified whenever the开发者_JAVA百科y are altered?
If you just want to be notified, set up a post-commit hook to send you an email when someone changes something.
If you want to automatically prevent the change, set up a pre-commit hook instead.
Better yet, move the external files in a separate repository, and include them in the normal one using svn:externals
. Then lock down the externals repository to RO for everybody, except people that have the right to update these (and the knowledge how to do it properly).
Subversion server have some hook scripts that are triggered when some actions happen. One of the hooks is post-commit, you could this trigger to develop a script that would check if the file is equal to the last revision or something like that.
http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.reposadmin.create.hooks
精彩评论