Me@0: #! /bin/sh Me@0: Me@0: #finds all from the current point in the directory tree Me@0: function find_repos() Me@0: { Me@0: FOUND_REPOS=$(find . -type d | grep -e ".hg$" | sed "s/\.hg//g") Me@0: echo -e $FOUND_REPOS Me@0: } Me@0: Me@0: function print_info() Me@0: { Me@0: echo -e "\n>> $1" Me@0: } Me@0: Me@0: function update_repos() Me@0: { Me@0: if [ -z "$1" ] Me@0: then Me@0: TAG="tip" Me@0: else Me@0: TAG=$1 Me@0: fi Me@0: REPOS=$( cat << EOF Me@0: ./ Me@0: ./src/VPThread_lib/ Me@0: ./src/VPThread_lib/VMS/ Me@0: ./src/VPThread_lib/VMS/DynArray/ Me@0: ./src/VPThread_lib/VMS/Histogram/ Me@0: ./src/VPThread_lib/VMS/Queue_impl/ Me@0: ./src/VPThread_lib/VMS/Hash_impl/ Me@0: EOF Me@0: ) Me@0: Me@0: BASE_DIR=$(pwd) Me@0: Me@0: for DIR in $REPOS Me@0: do Me@0: cd $DIR Me@0: hg pull Me@0: hg update $TAG Me@0: if [ $? -ne 0 ] Me@0: then Me@0: echo ">> Falling back from Tag to V0 checkout" Me@0: hg update V0 Me@0: if [ $? -ne 0 ] Me@0: then Me@0: echo ">> Falling back from Tag to Tip checkout" Me@0: hg update tip Me@0: fi Me@0: fi Me@0: cd $BASE_DIR Me@0: done Me@0: }