added a couple more patterns for overload report.
[feisty_meow.git] / scripts / rev_control / checkin.sh
1 #!/bin/bash
2
3 # checks in all the folders present in the REPOSITORY_LIST variable.
4
5 source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
6 source "$FEISTY_MEOW_SCRIPTS/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   if [ -d "CVS" ]; then cvs ci . ;
13   elif [ -d ".svn" ]; then svn ci . ;
14   elif [ -d ".git" ]; then
15     git add .  # snag all new files.  not to everyone's liking.
16     git commit .  # tell git about all the files and get a check-in comment.
17     git push  # upload the files to the server so others can see them.
18   else
19     echo unknown repository for $directory...
20   fi
21 }
22
23 # checks in all the folders in a specified list.
24 function checkin_list {
25   local list=$*
26   for i in $list; do
27     # turn repo list back into an array.
28     eval "repository_list=( ${REPOSITORY_LIST[*]} )"
29     for j in "${repository_list[@]}"; do
30       # add in the directory component.
31       j="$i/$j"
32       if [ ! -d "$j" ]; then continue; fi
33
34       pushd $j &>/dev/null
35       echo "checking in '$j'..."
36       do_checkin $j
37       popd &>/dev/null
38     done
39   done
40 }
41
42 if [ "$OS" != "Windows_NT" ]; then
43   # first get individual folders.
44   checkin_list $HOME
45 else
46   checkin_list $HOME c:/ d:/ e:/ 
47 fi
48