/[pcsx2_0.9.7]/auto_branch_latest_upstream.sh
ViewVC logotype

Contents of /auto_branch_latest_upstream.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 132 - (show annotations) (download) (as text)
Fri Sep 10 12:30:03 2010 UTC (10 years, 1 month ago) by william
File MIME type: application/x-sh
File size: 4217 byte(s)
add logic to better detect when/if to update the trunk
add auto_build logs
1 #!/bin/bash
2 . ./auto_defs.sh
3
4 export BRANCH_CREATE_SUCCESS="0"
5
6 export OVERRIDE_UPDATE_NEEDED_CHECK="0"
7 if [ "$1" == "--force-update" ] ; then
8 OVERRIDE_UPDATE_NEEDED_CHECK="1"
9 fi
10
11 export current_downstream_revision=`cat "$BRANCH_LOCATION/$BRANCH_NAME/upstream_repository_revision.txt"`
12 export current_local_revision=`cat "$BRANCH_LOCATION/$BRANCH_NAME/local_repository_revision.txt"`
13
14 if [ "$OVERRIDE_UPDATE_NEEDED_CHECK" != "1" ] ; then
15 if [ "$current_downstream_revision" == "$PCSX2_REVISION" ] ; then
16 if [ $current_local_revision -lt $PCSX2_REVISION_LOCAL ] ; then
17 echo "UPSTREAM REVISION: $PCSX2_REVISION"
18 echo "DOWNSTREAM REVISION: $current_downstream_revision"
19 echo "LOCAL REVISION: $current_local_revision"
20 echo "LOCAL COMMITTED REVISION: $PCSX2_REVISION_LOCAL"
21 else
22 echo "UPSTREAM REVISION: $PCSX2_REVISION"
23 echo "DOWNSTREAM REVISION: $current_downstream_revision"
24 echo "LOCAL REVISION: $current_local_revision"
25 echo "LOCAL COMMITTED REVISION: $PCSX2_REVISION_LOCAL"
26 echo
27 echo -e "\\tThere is no need to update the local repository. reason: upstream repository has not been updated and local has not been modified."
28 echo
29 echo -e "\\tAborting update of $downstream_export_location/trunk"
30 echo
31 exit 0
32 fi
33 else
34 echo "UPSTREAM REVISION: $PCSX2_REVISION"
35 echo "DOWNSTREAM REVISION: $current_downstream_revision"
36 echo "LOCAL REVISION: $current_local_revision"
37 echo "LOCAL COMMITTED REVISION: $PCSX2_REVISION_LOCAL"
38 fi
39 else
40 echo "UPSTREAM REVISION: $PCSX2_REVISION"
41 echo "DOWNSTREAM REVISION: $current_downstream_revision"
42 echo "LOCAL REVISION: $current_local_revision"
43 echo "LOCAL COMMITTED REVISION: $PCSX2_REVISION_LOCAL"
44 echo
45 echo -e "\\tDetected the use of: --force-update ... forcing update ..."
46 fi
47
48 echo $BRANCH_COMMIT_MESSAGE
49
50 rm -Rf "$BRANCH_LOCATION/$BRANCH_NAME"
51 #remove the latest branch from the base repository
52 #svn delete "$BRANCH_LOCATION/$BRANCH_NAME" --non-interactive --trust-server-cert
53 svn delete "$BRANCH_LOCATION/$BRANCH_NAME" --non-interactive --trust-server-cert >/dev/null 2>/dev/null && BRANCH_CREATE_SUCCESS="0" || BRANCH_CREATE_SUCCESS="1"
54
55 #update the working copy
56 #svn commit "$BRANCH_LOCATION" --non-interactive --trust-server-cert --depth immediates -m "remove latest branch for re-branching"
57 svn commit "$BRANCH_LOCATION" --non-interactive --trust-server-cert --depth immediates -m "remove latest branch for re-branching" >/dev/null 2>/dev/null && BRANCH_CREATE_SUCCESS="0" || BRANCH_CREATE_SUCCESS="1"
58
59 echo
60 echo -n "EXPORTING: $downstream_export_location/trunk to $BRANCH_LOCATION/$BRANCH_NAME ... "
61 #svn export --force $downstream_export_location/trunk "$BRANCH_LOCATION/$BRANCH_NAME"
62 svn export --force $downstream_export_location/trunk "$BRANCH_LOCATION/$BRANCH_NAME" 2>/dev/null && BRANCH_CREATE_SUCCESS="0" || BRANCH_CREATE_SUCCESS="1"
63
64
65 # add new branch to svn
66 echo
67 echo -n "Adding latest branch to svn ... "
68 #svn add "$BRANCH_LOCATION/$BRANCH_NAME"
69 svn add "$BRANCH_LOCATION/$BRANCH_NAME" >/dev/null 2>/dev/null && BRANCH_CREATE_SUCCESS="0" || BRANCH_CREATE_SUCCESS="1"
70 echo "Done."
71
72 cd "$BRANCH_LOCATION/$BRANCH_NAME"
73 # commit the newly created branch
74 #svn commit -m "$BRANCH_COMMIT_MESSAGE" "$BRANCH_LOCATION" --non-interactive --trust-server-cert
75 svn commit -m "$BRANCH_COMMIT_MESSAGE" "$BRANCH_LOCATION" --non-interactive --trust-server-cert >/dev/null 2>/dev/null && BRANCH_CREATE_SUCCESS="0" || BRANCH_CREATE_SUCCESS="1"
76
77
78 # call auto_build_latest_upstream.sh
79 #"$downstream_export_location/auto_import_patches.sh"
80 #"$downstream_export_location/auto_build.sh"
81 if [ "$BRANCH_CREATE_SUCCESS" == "1" ] ; then
82 "$downstream_export_location/auto_tag_latest_upstream.sh"
83 else
84 echo "AUTO BRANCH FAILED ... AUTO TAGGING NOT PERFORMED."
85 exit 1
86 fi

  ViewVC Help
Powered by ViewVC 1.1.22