jump to navigation

Subversion batch commands November 3, 2008

Posted by maxmil in : Subversion , add a comment

A few useful svn batch commands.

1) Add multiple files

svn st | grep "^?" | awk '{ print $2}' | while read f; do svn add $f; done

2) Revert multiple files

svn st | grep "^M" | awk '{ print $2}' | while read f; do svn revert $f; done

3) Delete multiple missing files

svn st | grep "^\!" | awk '{ print $2}' | while read f; do svn delete $f; done

Setting up subeclipse on eclipse 3.4 August 18, 2008

Posted by maxmil in : eclipse,Subversion , 3 comments

Having just installed eclipse 3.4 (gannymead) on my debian box it took a little bit of extra configuration to get subeclipse working due to the fact that i didn’t have the the JavaHL subversion client library installed.

These were the necessary steps with a fresh install of eclipse:

1) Download and install JavaHL. For debian this can be done using apt by installing the libsvn-java package.
2) Add the library to eclipse classpath by adding the following line to the -vmargs in eclipse.ini (check the installation path of the JavaHL library on your sistem
-Djava.library.path=/usr/lib/jni
1) Create a new subeclipse update site. Window > Software Updates > Available Software > Add Site: http://subclipse.tigris.org/update_1.4.x
2) Open the subeclipse update site and select the Subeclipse and JavaHL Adapter categories. Note that even though JavaHL Adapter is marked as recommended it is required.
3) Install and restart.

Done!

Merging branches with subversion May 9, 2008

Posted by maxmil in : Subversion , add a comment

A quick note to myself of the steps to take to merge a branch with the trunk using svn command line client.

1) Check out copy of trunk to a new foldersvn co svn://server/path/to/trunk
2) Check out a copy of the branch you are going to mergesvn co svn://server/path/to/branch/myBranch
3) Change directory to branchcd myBranch
4) Get the first revision number for myBranch. Look for the last revision numbersvn log --stop-on-copyNote the revision number of the branch.
5) Change to trunkcd ../trunk
6) Get last revision number of trunksnv up
7) Perform mergesvn merge -rBranchRevisionNumber:TrunkRevisionNumber svn://server/path/to/branch/myBranchWhere BranchRevisionNumber and TrunkRevisionNumber should be replaced by the numbers noted in earlier steps.
8) Resolve any conflicts.
9) Commit new version of trunksvn ci