Reverting to a previous Subversion revision

Reverting to a previous version of your software in Subversion, you merge the changes from your current revision back to the revision you want to revert to.

So, for example, if you want to revert the trunk of your application from revision 682 to 680, you would do the following:

svn merge -r 682:680 http://myrepository.com/my/project/trunk

Subversion calculates the changes between revision 682 and revision 680 of the trunk and applying them to your working copy.

If you want to see exactly what changes will be applied, do a diff:

svn diff -r 682:680 http://myrepository.com/my/project/trunk

Finally, since the merge happens on your local working copy, you need to commit it to the repository.

Post to Twitter Post to Yahoo Buzz Buzz This Post Post to Delicious Delicious Post to Digg Digg This Post Post to Ping.fm Ping This Post

Add comment 6 August 2010 at 3:43 PM

Recursively delete .svn directories

We use find command to find all .svn folders beginning from current directory:

$ find . -type d -name .svn

Now, we pass these directories to rm command, using backtick (key to left of ’1′) around find for command substitution:

$ rm -rf `find . -type d -name .svn`

Post to Twitter Post to Yahoo Buzz Buzz This Post Post to Delicious Delicious Post to Digg Digg This Post Post to Ping.fm Ping This Post

Add comment 9 April 2010 at 3:44 PM

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 Buzz This Post Post to Delicious Delicious Post to Digg Digg This Post Post to Ping.fm Ping This Post

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 Buzz This Post Post to Delicious Delicious Post to Digg Digg This Post Post to Ping.fm Ping This Post

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 Buzz This Post Post to Delicious Delicious Post to Digg Digg This Post Post to Ping.fm Ping This Post

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 Buzz This Post Post to Delicious Delicious Post to Digg Digg This Post Post to Ping.fm Ping This Post

1 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 Buzz This Post Post to Delicious Delicious Post to Digg Digg This Post Post to Ping.fm Ping This Post

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 Buzz This Post Post to Delicious Delicious Post to Digg Digg This Post Post to Ping.fm Ping This Post

1 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 Buzz This Post Post to Delicious Delicious Post to Digg Digg This Post Post to Ping.fm Ping This Post

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 Buzz This Post Post to Delicious Delicious Post to Digg Digg This Post Post to Ping.fm Ping This Post

1 comment 11 January 2008 at 12:20 PM

Previous Posts


Languages

Categories

Feeds

Links