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

  ViewVC Help
Powered by ViewVC 1.1.22