/[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 141 - (show annotations) (download) (as text)
Fri Sep 10 15:57:37 2010 UTC (10 years, 2 months ago) by william
File MIME type: application/x-sh
File size: 4791 byte(s)
fix branching
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 export BRANCH_COMMIT_MESSAGE="Creating $BRANCH_NAME branch for r$PCSX2_REVISION"
49
50 echo $BRANCH_COMMIT_MESSAGE
51
52 rm -Rf "$BRANCH_LOCATION/$BRANCH_NAME"
53 #remove the latest branch from the base repository
54 #echo "calling: svn delete $BRANCH_LOCATION/$BRANCH_NAME"
55 #svn delete "$BRANCH_LOCATION/$BRANCH_NAME" --non-interactive --trust-server-cert && BRANCH_CREATE_SUCCESS="1" || BRANCH_CREATE_SUCCESS="0"
56 svn delete "$BRANCH_LOCATION/$BRANCH_NAME" --non-interactive --trust-server-cert >/dev/null 2>/dev/null && BRANCH_CREATE_SUCCESS="1" || BRANCH_CREATE_SUCCESS="0"
57
58 #update the working copy
59 #echo "calling: svn commit $BRANCH_LOCATION"
60 #svn commit "$BRANCH_LOCATION" --non-interactive --trust-server-cert --depth immediates -m "remove latest branch for re-branching" && BRANCH_CREATE_SUCCESS="1" || BRANCH_CREATE_SUCCESS="0"
61 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="1" || BRANCH_CREATE_SUCCESS="0"
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" && BRANCH_CREATE_SUCCESS="1" || BRANCH_CREATE_SUCCESS="0"
65 svn export --force $downstream_export_location/trunk "$BRANCH_LOCATION/$BRANCH_NAME" 2>/dev/null && BRANCH_CREATE_SUCCESS="1" || BRANCH_CREATE_SUCCESS="0"
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" && BRANCH_CREATE_SUCCESS="1" || BRANCH_CREATE_SUCCESS="0"
72 svn add "$BRANCH_LOCATION/$BRANCH_NAME" >/dev/null 2>/dev/null && BRANCH_CREATE_SUCCESS="1" || BRANCH_CREATE_SUCCESS="0"
73 echo "Done."
74
75 cd "$BRANCH_LOCATION/$BRANCH_NAME"
76 echo
77 echo -n "Committing latest branch to svn ... "
78 # commit the newly created branch
79 #svn commit -m "$BRANCH_COMMIT_MESSAGE" "$BRANCH_LOCATION" --non-interactive --trust-server-cert && BRANCH_CREATE_SUCCESS="1" || BRANCH_CREATE_SUCCESS="0"
80 svn commit -m "$BRANCH_COMMIT_MESSAGE" "$BRANCH_LOCATION" --non-interactive --trust-server-cert >/dev/null 2>/dev/null && BRANCH_CREATE_SUCCESS="1" || BRANCH_CREATE_SUCCESS="0"
81 echo "Done."
82
83
84 # call auto_build_latest_upstream.sh
85 #"$downstream_export_location/auto_import_patches.sh"
86 #"$downstream_export_location/auto_build.sh"
87 if [ "$BRANCH_CREATE_SUCCESS" == "1" ] ; then
88 cd "$downstream_export_location/"
89 "$downstream_export_location/auto_tag_latest_upstream.sh"
90 else
91 echo "AUTO BRANCH FAILED ... AUTO TAGGING NOT PERFORMED."
92 exit 1
93 fi

  ViewVC Help
Powered by ViewVC 1.1.22