Include SVN revision number in source code

后端 未结 5 963
生来不讨喜
生来不讨喜 2020-12-09 10:23

My requirement is simple. At the beginning of each file there should be a block comment like this:

/*
 * This file was last modified by {username} at {date}          


        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-09 10:46

    I looked at this question and got some useful information. It is not exactly duplicate because I am working with NetBeans but the idea is the same. This is my header:

    /*
     * $LastChangedDate$
     * $LastChangedRevision$
     */
    

    Then I go to Team > Subversion > Svn properties and add svn:keywords as property name and LastChangedDate LastChangedRevision as property value.

    And when I commit from NetBeans it looks like this:

    /*
     * $LastChangedDate: 2012-02-13 17:38:57 +0200 (Пн, 13 II 2012) $
     * $LastChangedRevision: 27 $
     */
    

    Thanks all for the support! I will accept my answer because other answers do not include the NetBeans information. Nevertheless I give +1 to the other answers.

提交回复
热议问题