added useful gimp script, added better checking for nechung in rev control.
[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
13     # this appears to be cvs.
14 #    pushd "$directory/.." &>/dev/null
15     cvs ci .
16 ###"$directory"
17 #    popd &>/dev/null
18   elif [ -d ".svn" ]; then
19     svn ci .
20   elif [ -d ".git" ]; then
21     git commit .
22     git push
23   else
24     echo unknown repository for $directory...
25   fi
26 }
27
28 # checks in all the folders in a specified list.
29 function checkin_list {
30   local list=$*
31   for i in $list; do
32     # turn repo list back into an array.
33     eval "repository_list=( ${REPOSITORY_LIST[*]} )"
34     for j in "${repository_list[@]}"; do
35       # add in the directory component.
36       j="$i/$j"
37       if [ ! -d "$j" ]; then continue; fi
38
39       pushd $j &>/dev/null
40       echo "checking in '$j'..."
41       do_checkin $j
42       popd &>/dev/null
43     done
44   done
45 }
46
47 if [ "$OS" != "Windows_NT" ]; then
48   # first get individual folders.
49   checkin_list $HOME
50 else
51   checkin_list $HOME c:/ d:/ e:/ 
52 fi
53