first check-in of feisty meow codebase. many things broken still due to recent
[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 use_bare_name=0
9
10 # selects the method for check-in based on where we are.
11 function do_checkin()
12 {
13   directory="$1"; shift
14
15   pushd "$directory/.." &>/dev/null
16
17   # get the right modifier for the directory name.
18   compute_modifier "$directory" "in"
19
20   is_svn=1
21   checkin_cmd="echo unknown repository for $directory..."
22
23   if [ "$home_system" == "true" ]; then
24     checkin_cmd="svn ci ."
25 #    use_bare_name=1
26   fi
27
28   # then we pretty much ignore what we guessed, and just use the
29   # appropriate command for what we see inside the directory.
30   if [ -d "$directory/CVS" ]; then
31     checkin_cmd="cvs ci "
32     is_svn=0
33     modifier=  # reset the modifier, since we know we have cvs.
34 #    use_bare_name=0
35   elif [ -d "$directory/.svn" ]; then
36     checkin_cmd="svn ci ."
37 #    use_bare_name=1
38   fi
39
40 #  if [ "$use_bare_name" == "1" ]; then
41 #    directory=$(basename "$directory")
42 #  fi
43
44   if [ $is_svn -eq 1 ]; then
45     pushd "$directory" &>/dev/null
46     $checkin_cmd
47     popd &>/dev/null
48   else
49     $checkin_cmd "$modifier$directory"
50   fi
51   popd &>/dev/null
52 }
53
54 function checkin_list {
55   list=$*
56   for i in $list; do
57     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
58       if [ ! -d "$j" ]; then
59 #echo no directory called $j exists
60         continue
61       fi
62
63       pushd $i &>/dev/null
64       folder=$j
65       echo "checking in '$folder'..."
66       do_checkin $folder
67       popd &>/dev/null
68     done
69   done
70 }
71
72 if [ "$OS" != "Windows_NT" ]; then
73   # first get individual folders.
74   checkin_list $HOME
75 ##  # now check in the user's directory, if that is an asset in revision control.
76 ##  pushd $HOME  &>/dev/null
77 ##  cd ..
78 ##  echo "checking in '"$(pwd)"/$USER'..."
79 ##  $checkin_cmd $USER
80 ##  popd &>/dev/null
81 else
82   checkin_list c: c:/home d: d:/home e: e:/home f: f:/home g: g:/home h: h:/home i: i:/home 
83 fi
84