9

I would like to fill the comment tag @version with Subclipse or Subversion in Eclipse. CVS has done this automatically but Subversion isn't. This would be very helpful.

I tried to google "@version" but it seems impossible.

Example what CVS did:

<?php
 /* 
 * @author Spankmaster
 * @version $Id: file.php,v 1.47 2009-09-21 09:28:49 sp Exp $
 * @package mysoftware
 */

Example with SVN:

<?php
 /* 
 * @author Spankmaster
 * @version $Id: $ -> stays empty
 * @package mysoftware
 */

Please help.....

Michael Hackner
  • 8,605
  • 2
  • 27
  • 29
spankmaster79
  • 21,555
  • 10
  • 42
  • 73

2 Answers2

14

in svn it is $Revision$

/**
* Last changed: $LastChangedDate$
* @author $Author$
* @version $Revision$
*/

also you must add the keywords to the project (folders and files)

Property svn:keywords set to LastChangedDate Author Id Revision HeadURL

Marco
  • 2,306
  • 2
  • 26
  • 43
  • 1
    Like @Marco said, you need to set the proper attribute if you want the keyword substitution, see here: http://svnbook.red-bean.com/nightly/en/svn.advanced.props.special.keywords.html Also, in SVN exists the keyword $Id$ too, which get expanded in – Davide Gualano Feb 19 '10 at 11:07
  • 1
    You can do it in Eclipse: if you use SUbversive, right click on a file, choose Team -> set keyword – Davide Gualano Feb 19 '10 at 12:33
  • isn't there an option to do it for the whole project? Clicking every file in the project is not really an option – spankmaster79 Feb 19 '10 at 13:31
  • do this on the root folder from your project i think there is somewhere a option to do this recursive i use thortoise for that, that tool cal set it recursive – Marco Feb 19 '10 at 13:32
8

thx to Marco and Davide.

Just to sum it all up for Eclipse Users:

This will change all files, so you will have to do a checkin of the complete project again. So check-in all work before doing that.

I rightclick on the project, select "Team -> set Property"

Property name: Enter "svn:keywords"

Enter a text property: Enter "LastChangedDate Author Id Revision HeadURL"

Check the option "Set property recursively"

Click "OK"

spankmaster79
  • 21,555
  • 10
  • 42
  • 73