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

jamida picture jamida · Aug 19, 2010 · Viewed 10.2k times · Source

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?

Answer

pmod picture pmod · Aug 19, 2010

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