second test and nicer formatting
[feisty_meow.git] / scripts / rev_control / checkin.sh
index 2bddd3c39e2f748586c1ef13561cd3e8493fe5d4..7d734187dd4c0e8726bc82b3a6d924f85e0fee38 100644 (file)
@@ -1,48 +1,33 @@
 #!/bin/bash
 
-# checks in all the folders present in the REPOSITORY_LIST variable.
-
-source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
-source "$FEISTY_MEOW_SCRIPTS/rev_control/rev_control.sh"
-
-# selects the method for check-in based on where we are.
-function do_checkin()
-{
-  local directory="$1"; shift
-  if [ -d "CVS" ]; then cvs ci . ;
-  elif [ -d ".svn" ]; then svn ci . ;
-  elif [ -d ".git" ]; then
-    git add .  # snag all new files.  not to everyone's liking.
-    git commit .  # tell git about all the files and get a check-in comment.
-    git push  # upload the files to the server so others can see them.
-  else
-    echo unknown repository for $directory...
-  fi
-}
-
-# checks in all the folders in a specified list.
-function checkin_list {
-  local list=$*
-  for i in $list; do
-    # turn repo list back into an array.
-    eval "repository_list=( ${REPOSITORY_LIST[*]} )"
-    for j in "${repository_list[@]}"; do
-      # add in the directory component.
-      j="$i/$j"
-      if [ ! -d "$j" ]; then continue; fi
-
-      pushd $j &>/dev/null
-      echo "checking in '$j'..."
-      do_checkin $j
-      popd &>/dev/null
-    done
-  done
-}
-
-if [ "$OS" != "Windows_NT" ]; then
-  # first get individual folders.
-  checkin_list $HOME
-else
-  checkin_list $HOME c:/ d:/ e:/ 
+# checkin: checks in all the folders present in the REPOSITORY_LIST variable.
+
+source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+source "$FEISTY_MEOW_SCRIPTS/rev_control/version_control.sh"
+
+save_terminal_title
+
+##############
+
+echo "committing repositories at: $(date)"
+
+FULL_LIST=" $(dirname $FEISTY_MEOW_APEX) $HOME "
+if [ "$OS" == "Windows_NT" ]; then
+  FULL_LIST+=" c:/ d:/ e:/ "
 fi
 
+checkin_list $FULL_LIST
+exit_on_error "revision control check-in of list: $FULL_LIST"
+
+echo
+
+##############
+
+# regenerate the scripts after the check-in, since an update during check-in
+# could mean we have a modified version of feisty meow is present.
+regenerate
+
+##############
+
+restore_terminal_title
+