updated scheme for locating revision control assets; uses a list (in a
[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 "$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 echo whole list is ${REPOSITORY_LIST}
33     # turn repo list back into an array.
34     eval "repository_list=( ${REPOSITORY_LIST[*]} )"
35     for j in "${repository_list[@]}"; do
36       # add in the directory component.
37       j="$i/$j"
38 echo here the dir thing is: $j
39       if [ ! -d "$j" ]; then continue; fi
40
41       pushd $j &>/dev/null
42       echo "checking in '$j'..."
43       do_checkin $j
44       popd &>/dev/null
45     done
46   done
47 }
48
49 if [ "$OS" != "Windows_NT" ]; then
50   # first get individual folders.
51   checkin_list $HOME
52 else
53   checkin_list c: c:/home d: d:/home e: e:/home f: f:/home g: g:/home h: h:/home i: i:/home 
54 fi
55