tags:

views:

289

answers:

1

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 who made the changes and comments given by the user before checking the code into the file.

Is there any code template available for this?

+1  A: 

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.

Chuim