how can I have eclipse auto insert subversion revision number into my code

岁酱吖の 提交于 2019-12-03 12:58:00

问题


I'm interested in displaying the version number of my code in a help page. Ideally I'd use a Major.Minor.SVNrevision format, where the SVNrevision number was pulled automatically. I hope? Suspect there's a variable I can access somewhere, but have no idea what it may be.

Any hints?


回答1:


You can do this by adding so-called SVN Keywords into your working files. This chapter contains standard SVN keywords. Then you have two options:

  1. set property for each folder svn:keywords to make this substitution available for all who works with this repository: svn propset svn:keywords "Date Author Revision" help.html

  2. modify svn configuration file (on Windows: %USERPROFILE%\Application Data\Subversion\config, on Linux: ~/.subversion/config) to enable automatic properties for all repositories and files (according to pattern) you're working with: set enable-auto-props to yes and then add to [auto-props] section: *.html = svn:keywords=Date Author Revision




回答2:


If your help files are versioned, I would add an external script as an Eclipse builder in order to make some keyword substitution (using for instance svnversion)

But if your help files are generated, may be this kind of script can help (also based on svnversion to get back the "GlobalRev").

Major and Minor version information need to be stored and retrieved from another souce though: they are not "svn-related" informations.



来源:https://stackoverflow.com/questions/3518843/how-can-i-have-eclipse-auto-insert-subversion-revision-number-into-my-code

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