X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Frev_control%2Fcheckin.sh;h=636eedabeb399b21cd46976b3a027a34c2e7bae6;hb=541783feb1e22d7cb43141640bc45e5d8f5fe8da;hp=1fcc8d8c4d219472ab5d4144406984e714d1af6b;hpb=2952ccf47b80174880141a7ecfa122089f349b8d;p=feisty_meow.git diff --git a/scripts/rev_control/checkin.sh b/scripts/rev_control/checkin.sh index 1fcc8d8c..636eedab 100644 --- a/scripts/rev_control/checkin.sh +++ b/scripts/rev_control/checkin.sh @@ -1,84 +1,53 @@ #!/bin/bash -# checks in all our commonly used folders. -# note: fred specific. +# checks in all the folders present in the REPOSITORY_LIST variable. -source "$SHELLDIR/rev_control/rev_control.sh" - -use_bare_name=0 +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() { - directory="$1"; shift - - pushd "$directory/.." &>/dev/null - - # get the right modifier for the directory name. - compute_modifier "$directory" "in" - - is_svn=1 - checkin_cmd="echo unknown repository for $directory..." - - if [ "$home_system" == "true" ]; then - checkin_cmd="svn ci ." -# use_bare_name=1 - fi - - # then we pretty much ignore what we guessed, and just use the - # appropriate command for what we see inside the directory. - if [ -d "$directory/CVS" ]; then - checkin_cmd="cvs ci " - is_svn=0 - modifier= # reset the modifier, since we know we have cvs. -# use_bare_name=0 - elif [ -d "$directory/.svn" ]; then - checkin_cmd="svn ci ." -# use_bare_name=1 - fi - -# if [ "$use_bare_name" == "1" ]; then -# directory=$(basename "$directory") -# fi - - if [ $is_svn -eq 1 ]; then - pushd "$directory" &>/dev/null - $checkin_cmd - popd &>/dev/null + local directory="$1"; shift + if [ -d "CVS" ]; then cvs ci . ; + elif [ -d ".svn" ]; then svn ci . ; + elif [ -d ".git" ]; then + # snag all new files. not to everyone's liking. + git add . + # tell git about all the files and get a check-in comment. + git commit . + # upload the files to the server so others can see them. + git push 2>&1 | grep -v "X11 forwarding request failed" else - $checkin_cmd "$modifier$directory" + echo unknown repository for $directory... fi - popd &>/dev/null } +# checks in all the folders in a specified list. function checkin_list { - list=$* + local list=$* for i in $list; do - 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 - if [ ! -d "$j" ]; then -#echo no directory called $j exists - continue - fi - - pushd $i &>/dev/null - folder=$j - echo "checking in '$folder'..." - do_checkin $folder + # 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 } +echo "Committing repositories at: $(date)" + if [ "$OS" != "Windows_NT" ]; then # first get individual folders. checkin_list $HOME -## # now check in the user's directory, if that is an asset in revision control. -## pushd $HOME &>/dev/null -## cd .. -## echo "checking in '"$(pwd)"/$USER'..." -## $checkin_cmd $USER -## popd &>/dev/null else - checkin_list c: c:/home d: d:/home e: e:/home f: f:/home g: g:/home h: h:/home i: i:/home + checkin_list $HOME c:/ d:/ e:/ fi