Enable Auto Properties (auto-props) for Subversion (Subclipse) in Eclipse

Setting auto properties (auto-props) allows for specific files to have unique properties applied such as mime types (svn:mime-type), end of line (svn:eol-style), and my personal favorite: svn:keywords.

I use svn:keywords to automatically update the following fields that I store at the top of each code file: "LastChangedDate LastChangedRevision LastChangedBy Id". Each time I commit a file relevant data is updated on the file itself that can tell me who last committed changes and when they did. As well the version number is updated.

The header of each file contains the following tokens:

$LastChangedDate:$
$LastChangedRevision:$
$LastChangedBy:$

To enable this in Eclipse first create a custom subversion config directory and file. I typically create a ~/var/lib/subversion/conf/ directory and add a text file to it called "config". I then add the following to the config file:

[miscellany]
enable-auto-props = yes

[auto-props]
* = svn:keywords=LastChangedDate LastChangedRevision LastChangedBy Id

Now open Eclipse and go to Windows->Preferences->Team->SVN and set the "Configuration location" to "Use directory" and browser to the newly created conf directory.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

default config file

Can I also edit the default subversion config file and uncomment the enable-auto-props property and add the * under [auto-props ] ?
I've done this. But I don't have the impression Eclipse is noticing this because the properties aren't replaced when I commit.
The only thing that works is using Team - Set property. But I don't want to use that feature because it doesn't allow me to state that I only want these keywords "used" on particular types of files. Eg only .java files.
Any advice
Thanks,
EDH

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h1> <h2> <h3> <h4> <h5> <h6> <pre> <hr>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
8 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.