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

Annotation of /auto_branch_latest_upstream.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 131 - (hide 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 william 93 #!/bin/bash
2 william 94 . ./auto_defs.sh
3 william 93
4 william 105 export BRANCH_CREATE_SUCCESS="0"
5 william 93
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 william 129 export current_local_revision=`cat "$BRANCH_LOCATION/$BRANCH_NAME/local_repository_revision.txt"`
13 william 93
14     if [ "$OVERRIDE_UPDATE_NEEDED_CHECK" != "1" ] ; then
15 william 130 if [ "$current_downstream_revision" == "$PCSX2_REVISION" && "$current_local_revision" -lt "$PCSX2_REVISION_LOCAL" ] ; then
16 william 129 echo "UPSTREAM REVISION: $PCSX2_REVISION"
17 william 93 echo "DOWNSTREAM REVISION: $current_downstream_revision"
18 william 130 echo "LOCAL REVISION: $current_local_revision"
19     echo "LOCAL COMMITTED REVISION: $PCSX2_REVISION_LOCAL"
20 william 93 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 william 131 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 william 93 fi
32     else
33 william 130 if [ "$current_downstream_revision" == "$PCSX2_REVISION" && "$current_local_revision" -lt "$PCSX2_REVISION_LOCAL" ] ; then
34 william 129 echo "UPSTREAM REVISION: $PCSX2_REVISION"
35 william 93 echo "DOWNSTREAM REVISION: $current_downstream_revision"
36 william 130 echo "LOCAL REVISION: $current_local_revision"
37     echo "LOCAL COMMITTED REVISION: $PCSX2_REVISION_LOCAL"
38 william 93 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 william 131 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 william 93 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 william 105 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 william 93
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 william 105 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 william 93
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 william 105 svn export --force $downstream_export_location/trunk "$BRANCH_LOCATION/$BRANCH_NAME" 2>/dev/null && BRANCH_CREATE_SUCCESS="0" || BRANCH_CREATE_SUCCESS="1"
66 william 93
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 william 105 svn add "$BRANCH_LOCATION/$BRANCH_NAME" >/dev/null 2>/dev/null && BRANCH_CREATE_SUCCESS="0" || BRANCH_CREATE_SUCCESS="1"
73 william 93 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 william 105 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 william 93
80    
81     # call auto_build_latest_upstream.sh
82 william 104 #"$downstream_export_location/auto_import_patches.sh"
83     #"$downstream_export_location/auto_build.sh"
84 william 105 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