Include SVN revision number in source code

后端 未结 5 954
生来不讨喜
生来不讨喜 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:48

    As this data only exists after the file was committed it should be set by SVN itself, not a client program. (And client-side processing tends to get disabled or not configured at all.) This means there is no simple template/substitute like you want, because then after the first replacement the template variables would be lost.

    You can find information abut SVN's keyword substitution here. Then things like $Rev$ can be replaced by $Rev: 12 $.

提交回复
热议问题