Turnleaf Design Ramblings of a junior developer

18Oct/092

Taming of the Subversion, a SVN primer; part 3

In the third and final part to my SVN primer I will finish up with my day to day tasks and I will go over how to add SVN properties to your project. The first two parts can be found here: 12.

More Terminology:

BASE – Refers to the most recent revision currently on your local workspace.

SVN Commands:

Comparing revisions – To see what changes have been made between two revisions a comparison can be run. The changes will be highlighted in gray, along with a box showing where in the older revision the change fits in. To compare revisions right click>compare with and then select the option that best suits your needs.

Merging – One of my least favorite of SVN commands, not because there is anything wrong with the merge feature (it's actually a great feature), but often when I run merges I have to deal with several conflicts, which I never find an enjoyable experience.  Anyways merging is a little trickier than you might think. Initially you might try merging the head of your branch (or whatever you are merging) with the head of your trunk, however this is incorrect. You actually need to merge the head of your branch with the revision of your trunk when you made the branch. This needs to be done because Subversion needs to know what actually has changed since the branch was made.

Add – If there is a file that is not under version control, but you would like it to be include this can be done by right clicking on the file team>add to version control

Ignore – On the flip side, if  you do not want a file to be under version control right clicking>team>add to svn:ignore

SVN properties – One really useful feature is svn properties. There are a wide assortment of svn properties that allow you to do things like add meta information to a file (author, revision number, last modified, etc.), include a tracking number and link to a bug tracking system, among many other options. The easiest way to setup properties using subclipse is through the “Show Properties” view. Right click on the SVNProject root folder and go to Team>Show Properties. To add a property right click any where in the spreadsheet looking area and select “add property.” Select the desired property and setup the property's value. To setup the ability to use a bug tracking through svn we will need the following three properties added:

null

Bugtraq:label - Displays a message next to the box where a developer would put the (comma separated) issue numbers.
Bugtraq:url – This is the url to your bug tracking system. The “%BUGID%” appends the tracking numbered entered to its location in the url.
Bugtraq:message - Displays a message in the history view. “%BUGID%” creates a link to the bug entered during the commit.

The end product, when you select a specific revision in the view history view in the bottom left you should get a message like “Tracker #s: 123” With "123" being a link tracker 123 in your bug tracking system. Eclipse has a built in browser, so when this link is clicked a browser window should open within Eclipse taking you to the issue.

This concludes my SVN primer. I hope anybody who reads this finds it useful. If you have any questions let me know. For more information on SVN you can check out these links:
http://markphip.blogspot.com/ - The blog run by the director of subversion engineering at Collbanet
http://svnbook.red-bean.com/en/1.5/index.html – A huge guide on how to use Subversion

Bookmark and Share

Technorati Tags: ,

Related posts:

  1. Taming of the Subversion, a SVN primer; part 2
  2. Taming of the Subversion, a SVN primer; part 1
Comments (2) Trackbacks (0)
  1. Thanks for this.

    What’ll be good strategy to name the branch/tag labels?

    • That would be largely dependent upon how your company operates. But I did say most tags and or branches should include some sort of reference to a date and/or version number.


Leave a comment


No trackbacks yet.