diff scripts/repo_update_helper.sh @ 0:21573f5b2e84

initial add -- all data from Sean's machine
author Me@portablequad
date Mon, 28 Nov 2011 15:37:08 -0800
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/scripts/repo_update_helper.sh	Mon Nov 28 15:37:08 2011 -0800
     1.3 @@ -0,0 +1,53 @@
     1.4 +#! /bin/sh
     1.5 +
     1.6 +#finds all from the current point in the directory tree
     1.7 +function find_repos()
     1.8 +{
     1.9 +    FOUND_REPOS=$(find . -type d | grep -e ".hg$" | sed "s/\.hg//g")
    1.10 +    echo -e $FOUND_REPOS
    1.11 +}
    1.12 +
    1.13 +function print_info()
    1.14 +{
    1.15 +    echo -e "\n>> $1"
    1.16 +}
    1.17 +
    1.18 +function update_repos()
    1.19 +{
    1.20 +    if [ -z "$1" ]
    1.21 +    then
    1.22 +        TAG="tip"
    1.23 +    else
    1.24 +        TAG=$1
    1.25 +    fi
    1.26 +    REPOS=$( cat << EOF
    1.27 +./
    1.28 +./src/VPThread_lib/
    1.29 +./src/VPThread_lib/VMS/
    1.30 +./src/VPThread_lib/VMS/DynArray/
    1.31 +./src/VPThread_lib/VMS/Histogram/
    1.32 +./src/VPThread_lib/VMS/Queue_impl/
    1.33 +./src/VPThread_lib/VMS/Hash_impl/
    1.34 +EOF
    1.35 +)
    1.36 +
    1.37 +    BASE_DIR=$(pwd)
    1.38 +
    1.39 +    for DIR in $REPOS
    1.40 +    do
    1.41 +        cd $DIR
    1.42 +        hg pull
    1.43 +        hg update $TAG
    1.44 +        if [ $? -ne 0 ]
    1.45 +        then
    1.46 +            echo ">> Falling back from Tag to V0 checkout"
    1.47 +            hg update V0
    1.48 +            if [ $? -ne 0 ]
    1.49 +            then
    1.50 +                echo ">> Falling back from Tag to Tip checkout"
    1.51 +                hg update tip
    1.52 +            fi
    1.53 +        fi
    1.54 +        cd $BASE_DIR
    1.55 +    done
    1.56 +}
    1.57 \ No newline at end of file