tossing a few older svn and cvs scripts out. the need to tag bunches of files as...
[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/rev_control/rev_control.sh"
6
7 # selects the method for check-in based on where we are.
8 function do_checkin()
9 {
10   local directory="$1"; shift
11   if [ -d "CVS" ]; then
12     # this appears to be cvs.
13 #    pushd "$directory/.." &>/dev/null
14     cvs ci .
15 ###"$directory"
16 #    popd &>/dev/null
17   elif [ -d ".svn" ]; then
18     svn ci .
19   elif [ -d ".git" ]; then
20     git commit .
21     git push
22   else
23     echo unknown repository for $directory...
24   fi
25 }
26
27 # checks in all the folders in a specified list.
28 function checkin_list {
29   local list=$*
30   for i in $list; do
31     # turn repo list back into an array.
32     eval "repository_list=( ${REPOSITORY_LIST[*]} )"
33     for j in "${repository_list[@]}"; do
34       # add in the directory component.
35       j="$i/$j"
36       if [ ! -d "$j" ]; then continue; fi
37
38       pushd $j &>/dev/null
39       echo "checking in '$j'..."
40       do_checkin $j
41       popd &>/dev/null
42     done
43   done
44 }
45
46 if [ "$OS" != "Windows_NT" ]; then
47   # first get individual folders.
48   checkin_list $HOME
49 else
50   checkin_list c: c:/home d: d:/home e: e:/home f: f:/home g: g:/home h: h:/home i: i:/home 
51 fi
52