Version Controlling Systems - SVN and BZR
Thursday, November 1st, 2007I 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

