Checking for updates in subversion

If you are constantly running svn up or svn status -u or maybe svn log -rBASE:HEAD then you might find this piece of code useful:

#!/bin/sh  
  
dir="$1"

cd $dir
  
updated=$(svn st -u | grep '*') 

if [ "$updated" ]; then
	notify-send SVN "$updated"
fi

What id does is check for updates in subversion and if it finds any then shows a notification using notify-send. Tested on openSUSE 11.1 with subversion 1.6. Add a crontab entry and you are done.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.