Merge branch 'master' of zooty:feisty_meow
[feisty_meow.git] / scripts / rev_control / checkin.sh
1 #!/bin/bash
2
3 # checks in all our commonly used folders.
4 # note: fred specific.
5
6 source "$SHELLDIR/rev_control/rev_control.sh"
7
8 # selects the method for check-in based on where we are.
9 function do_checkin()
10 {
11   local directory="$1"; shift
12 echo dir is $directory
13 echo cur dir is $(pwd)
14   if [ -d "CVS" ]; then
15     # this appears to be cvs.
16     pushd "$directory/.." &>/dev/null
17     cvs ci "$directory"
18     popd &>/dev/null
19   elif [ -d ".svn" ]; then
20     svn ci .
21   elif [ -d ".git" ]; then
22     git commit .
23     git push
24   else
25     echo unknown repository for $directory...
26   fi
27 }
28
29 function checkin_list {
30   local list=$*
31   for i in $list; do
32     for j in $i/feisty_meow $i/hoople $i/hoople2 $i/quartz $i/web $i/yeti $i/xsede/xsede_tests $i/xsede/code/cak0l/trunk ; do
33       if [ ! -d "$j" ]; then continue; fi
34
35       pushd $j &>/dev/null
36       folder=$j
37       echo "checking in '$folder'..."
38       do_checkin $folder
39       popd &>/dev/null
40     done
41   done
42 }
43
44 if [ "$OS" != "Windows_NT" ]; then
45   # first get individual folders.
46   checkin_list $HOME
47 else
48   checkin_list c: c:/home d: d:/home e: e:/home f: f:/home g: g:/home h: h:/home i: i:/home 
49 fi
50