view scripts/repo_update_helper.sh @ 5:0fb514d583de

exec time vs task size: results until 12/12/2011
author Merten Sach <msach@mailbox.tu-berlin.de>
date Mon, 12 Dec 2011 20:28:31 +0100
parents
children
line source
1 #! /bin/sh
3 #finds all from the current point in the directory tree
4 function find_repos()
5 {
6 FOUND_REPOS=$(find . -type d | grep -e ".hg$" | sed "s/\.hg//g")
7 echo -e $FOUND_REPOS
8 }
10 function print_info()
11 {
12 echo -e "\n>> $1"
13 }
15 function update_repos()
16 {
17 if [ -z "$1" ]
18 then
19 TAG="tip"
20 else
21 TAG=$1
22 fi
23 REPOS=$( cat << EOF
24 ./
25 ./src/VPThread_lib/
26 ./src/VPThread_lib/VMS/
27 ./src/VPThread_lib/VMS/DynArray/
28 ./src/VPThread_lib/VMS/Histogram/
29 ./src/VPThread_lib/VMS/Queue_impl/
30 ./src/VPThread_lib/VMS/Hash_impl/
31 EOF
32 )
34 BASE_DIR=$(pwd)
36 for DIR in $REPOS
37 do
38 cd $DIR
39 hg pull
40 hg update $TAG
41 if [ $? -ne 0 ]
42 then
43 echo ">> Falling back from Tag to V0 checkout"
44 hg update V0
45 if [ $? -ne 0 ]
46 then
47 echo ">> Falling back from Tag to Tip checkout"
48 hg update tip
49 fi
50 fi
51 cd $BASE_DIR
52 done
53 }