Subversion keywords on Java files

Subversion has the ability to substitute keywords—pieces of useful, dynamic information about a versioned file—into the contents of the file itself. The list of keywords available for substitution are:

  • Date - describes the last time the file was known to have been changed in the repository.
  • Revision - describes the last known revision in which this file changed in the repository.
  • Author - describes the last known user to change this file in the repository.
  • Id - is a compressed combination of the other keywords.

Now combine svn-keywords with JavaDoc of a Java Class. A tipically header template can be:

/**
 * CLASS DESCRIPTION
 *
 * @author Pasquale Marcoccia
 * @version $Revision$ on $Date$ by $Author$
 */

or:

/**
 * CLASS DESCRIPTION
 *
 * @author Pasquale Marcoccia
 * @version $Id$
 */

To tell Subversion whether or not to substitute keywords on a particular file, we can use propset subcommand. The svn:keywords property, when set on a versioned file, controls which keywords will be substituted on that file. The value is a space-delimited list of the keyword names.

svn propset svn:keywords "Date Revision Author Id" MyClass.java

We can set keywords on all java files in a directory:

find myProject/ -type f -name '*.java' -exec svn propset svn:keywords "Date Revision Author Id" {}  \; -print

Instead, for files added later, we can automatically set keywords changing svn config file (~/.subversion/config):

[miscellany]
enable-auto-props = yes
[auto-props]
*.java = svn:keywords=Date Revision Author Id

[Post to Twitter]  [Post to Yahoo Buzz]  [Post to Delicious]  [Post to Digg]  [Post to Ping.fm] 

Add comment 5 April 2009 at 11:10 AM

Project Management with Maven

Sorry, but this post is not available in English

[Post to Twitter]  [Post to Yahoo Buzz]  [Post to Delicious]  [Post to Digg]  [Post to Ping.fm] 

3 comments 1 March 2009 at 4:46 PM

Maven Fundamentals

Sorry, but this post is not available in English

[Post to Twitter]  [Post to Yahoo Buzz]  [Post to Delicious]  [Post to Digg]  [Post to Ping.fm] 

2 comments 26 February 2009 at 9:48 PM

Resize a VMWare disk

To resize a VMWare disk there is an easy way: VMWare vCenter Converter. Unfortunately a linux version is not available. Additionally, this process seems to be very slow and at the end VMWare Tools needs to be re-installed.

So here a manual procedure:

  • turn off the virtual machine
  • remove all snapshots (or revert to one)
  • run

    vmware-vdiskmanager -x {size} {disk}

    where
    {size} is the new size of the disk (for example 8GB) and
    {disk} is the full path of the file .vmdk.


This procedure only expands the disk and not the partition. If the virtual disk is partitioned, you will need to use a third-party utility to resize the expanded partitions (Partition Magic, GParted Live CD, Paragon Partition Manager). If you are using the Windows DiskPart utility, it can only extend data volumes; if you use the DiskPart utility to extend a system or boot volume, you may get an error.

[Post to Twitter]  [Post to Yahoo Buzz]  [Post to Delicious]  [Post to Digg]  [Post to Ping.fm] 

Add comment 21 January 2009 at 5:47 PM

Thread logging on JBoss

Sorry, but this post is not available in English

[Post to Twitter]  [Post to Yahoo Buzz]  [Post to Delicious]  [Post to Digg]  [Post to Ping.fm] 

Add comment 2 December 2008 at 11:53 AM

JBoss Programmatically timers

Sorry, but this post is not available in English

[Post to Twitter]  [Post to Yahoo Buzz]  [Post to Delicious]  [Post to Digg]  [Post to Ping.fm] 

Add comment 27 February 2008 at 3:52 PM

TRACE Logging in JBoss

Sorry, but this post is not available in English

[Post to Twitter]  [Post to Yahoo Buzz]  [Post to Delicious]  [Post to Digg]  [Post to Ping.fm] 

Add comment 17 January 2008 at 11:12 AM

IT Go-getting

Sorry, but this post is not available in English

[Post to Twitter]  [Post to Yahoo Buzz]  [Post to Delicious]  [Post to Digg]  [Post to Ping.fm] 

Add comment 11 January 2008 at 12:20 PM

Modify WebService SOAP Address in JBoss

Sorry, but this post is not available in English

[Post to Twitter]  [Post to Yahoo Buzz]  [Post to Delicious]  [Post to Digg]  [Post to Ping.fm] 

Add comment 10 January 2008 at 12:23 PM

grep, sed & awk

Sorry, but this post is not available in English

[Post to Twitter]  [Post to Yahoo Buzz]  [Post to Delicious]  [Post to Digg]  [Post to Ping.fm] 

Add comment 3 January 2008 at 4:56 PM

Previous Posts


Languages

Categories

Feeds

Links