Inserting comments automatically using TortoiseSVN?

陌路散爱 提交于 2020-01-13 07:15:08

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!