Version Controlling Systems - SVN and BZR

Posted in Linux, Programming, shell scripts, svn by sandaruwan on November 1st, 2007

I have been using both “svn” and “bzr” lately. “svn” is a quite popular system, have been there for many years. “bzr” is developed by Ubuntu team to use as their version controlling system. Even though bzr is quite new to the field, it’s pretty much transparent to the user. For example if you type “bzr add” in the root bzr branch directory, then all the newly added to the repository recursively whereas svn doesn’t do that recursively. “bzr” is capable of detecting removed files, but “svn” is not; you’ll have to delete the files manually. That’s really annoying.

So, I wrote a small shell script to handle those.

#!/bin/bash

svn status | while read line; do
	command=`echo $line | awk '{print $1}'`
	file=`echo $line | awk '{print $2}'`
	if [ "$command" = "?" ]; then
		echo “Add $file”
		svn add $file
	fi
	if [ "$command" = "!" ]; then
		echo “Remove $file”
		svn delete $file
	fi
done

One Response to “Version Controlling Systems - SVN and BZR”

  1. Peter Krnjevic Says:

    If you like bzr, you should try mercurial (hg).

    December 18th, 2007 at 8:44 pm

Leave a Reply