cleaned up commented code that moved to vers ctrl lib.
[feisty_meow.git] / scripts / rev_control / rev_diff.sh
1 #!/bin/bash
2 # does differences on a set of folders checked out from subversion or git.
3 # this can take a directory as parameter, but will default to the current
4 # working directory.  all the directories under the passed directory will
5 # be examined.
6
7 dir="$1"; shift
8 if [ -z "$dir" ]; then
9   dir=.
10 fi
11
12 pushd "$dir" &>/dev/null
13
14 for i in * ; do
15   if [ -d "$i" ]; then
16     echo "[$i]"
17     pushd $i &>/dev/null
18     # only update if we see a repository living there.
19     if [ -d ".svn" ]; then
20       svn diff .
21     elif [ -d ".git" ]; then
22       git diff 
23     elif [ -d "CVS" ]; then
24       cvs diff .
25     fi
26     popd &>/dev/null
27     echo "======="
28   fi
29 done
30
31 popd &>/dev/null
32