问题
Tricky question: I need the following to happen:
1) Before you click commit, tortoisesvn should insert a legal notice comment to the code files being commited. I am talking about client side event ONLY.
2) Svn:keywords are not going to work because those keywords need to be in the file already.
May be there is a way to write plugin for tortoise?
回答1:
CLIENT SIDE HOOK SCRIPTS (SAFE but svn client specific):
The only safe way to do it is to use client side hook scripts. Here a hint on how to perform this with TortoiseSVN: http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-dug-settings.html
DO NOT USE SERVER HOOK SCRIPTS:
Server side hook scripts won't help, it is not allowed to modify data there (thought not enforced). The reason is that the server side script cannot modify your local copy and you end up in mismatching data. See http://svnbook.red-bean.com/nightly/en/svn.reposadmin.create.html#svn.reposadmin.create.hooks for more details regarding this.
回答2:
Should this really be a client side action? If its really important, why not a pre-commit hook on the server to verify the disclaimer and update the code if its not present?
来源:https://stackoverflow.com/questions/1651120/inserting-comments-automatically-using-tortoisesvn