开发者

How to include the svn keywords in Eclipse Code templates

I am using Eclipse and SVN as a source repository. Whenever the user checks in the code I want to add the SVN version and userid of w开发者_Go百科ho made the changes and comments given by the user before checking the code into the file.

Is there any code template available for this?


Subversion has a feature named Keyword Substitution (this is it's manual page) that does almost everything that you want for text files: you can get the revision number, the username and a couple of other informations, but not the commit comments.

Basically you must enable a SVN property for files where this should happen and insert keywords in the form of $MyKeyword$ where you'd like to have the information. During the commit operation they will be replaced (it's a client side operation). Please, refer to the manual page for specific instructions.

Just mind that there are some implications when using this feature. For instance, the file is changed when committing so it will need to be recompiled (depending on language used). Also, these files will more frequently show up as conflicts in diffs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜