[llvm] r225736 - Release tag script: add -revision option

Hans Wennborg hans at hanshq.net
Mon Jan 12 16:07:30 PST 2015


Author: hans
Date: Mon Jan 12 18:07:29 2015
New Revision: 225736

URL: http://llvm.org/viewvc/llvm-project?rev=225736&view=rev
Log:
Release tag script: add -revision option

It seems useful to be able to create the branch at a revision that looks good
on the buildbots.

Modified:
    llvm/trunk/utils/release/tag.sh

Modified: llvm/trunk/utils/release/tag.sh
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/release/tag.sh?rev=225736&r1=225735&r2=225736&view=diff
==============================================================================
--- llvm/trunk/utils/release/tag.sh (original)
+++ llvm/trunk/utils/release/tag.sh Mon Jan 12 18:07:29 2015
@@ -19,18 +19,20 @@ rc=""
 rebranch="no"
 projects="llvm cfe dragonegg test-suite compiler-rt libcxx libcxxabi clang-tools-extra polly lldb lld openmp"
 dryrun=""
+revision="HEAD"
 
 base_url="https://llvm.org/svn/llvm-project"
 
 function usage() {
-    echo "usage: `basename $0` -release <num> [-rebranch] [-dry-run]"
+    echo "usage: `basename $0` -release <num> [-rebranch] [-revision <num>] [-dry-run]"
     echo "usage: `basename $0` -release <num> -rc <num> [-dry-run]"
     echo " "
-    echo "  -release <num>  The version number of the release"
-    echo "  -rc <num>       The release candidate number"
-    echo "  -rebranch       Remove existing branch, if present, before branching"
-    echo "  -final          Tag final release candidate"
-    echo "  -dry-run        Make no changes to the repository, just print the commands"
+    echo "  -release <num>   The version number of the release"
+    echo "  -rc <num>        The release candidate number"
+    echo "  -rebranch        Remove existing branch, if present, before branching"
+    echo "  -final           Tag final release candidate"
+    echo "  -revision <num>  Revision to branch off (default: HEAD)"
+    echo "  -dry-run         Make no changes to the repository, just print the commands"
 }
 
 function tag_version() {
@@ -43,7 +45,8 @@ function tag_version() {
             ${dryrun} svn remove -m "Removing old release_$branch_release branch for rebranching." \
                 $base_url/$proj/branches/release_$branch_release
         fi
-        ${dryrun} svn copy -m "Creating release_$branch_release branch" \
+        ${dryrun} svn copy -m "Creating release_$branch_release branch off revision ${revision}" \
+            -r ${revision} \
             $base_url/$proj/trunk \
             $base_url/$proj/branches/release_$branch_release
     done
@@ -81,6 +84,10 @@ while [ $# -gt 0 ]; do
         -final | --final )
             rc="final"
             ;;
+        -revision | --revision )
+            shift
+            revision="$1"
+            ;;
         -dry-run | --dry-run )
             dryrun="echo"
             ;;
@@ -110,6 +117,13 @@ tag_release=`echo $release | sed -e 's,\
 if [ "x$rc" = "x" ]; then
     tag_version
 else
+    if [ "x$revision" != "x" ]; then
+        echo "error: cannot use -revision with -rc"
+        echo
+        usage
+        exit 1
+    fi
+
     tag_release_candidate
 fi
 





More information about the llvm-commits mailing list