From 269a6bd0b2d9b1cae4ca3e88fd5a902b93f1bdff Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Fri, 17 Jan 2020 09:35:34 +0100 Subject: [PATCH] Remove old Suversion release scripts --- utils/release/merge-git.sh | 91 ----------------------- utils/release/merge.sh | 100 ------------------------- utils/release/tag.sh | 145 ------------------------------------- 3 files changed, 336 deletions(-) delete mode 100755 utils/release/merge-git.sh delete mode 100755 utils/release/merge.sh delete mode 100755 utils/release/tag.sh diff --git a/utils/release/merge-git.sh b/utils/release/merge-git.sh deleted file mode 100755 index 33162f6c813..00000000000 --- a/utils/release/merge-git.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash -#===-- merge-git.sh - Merge commit to the stable branch --------------------===# -# -# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -# See https://llvm.org/LICENSE.txt for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# -#===------------------------------------------------------------------------===# -# -# This script will merge an svn revision to a git repo using git-svn while -# preserving the svn commit message. -# -# NOTE: This script has only been tested with the per-project git repositories -# and not with the monorepo. -# -# In order to use this script, you must: -# 1) Checkout the stable branch you would like to merge the revision into. -# 2) Correctly configure the branch as an svn-remote by adding the following to -# your .git/config file for your git repo (replace xy with the major/minor -# version of the release branch. e.g. release_50 or release_60): -# -#[svn-remote "release_xy"] -#url = https://llvm.org/svn/llvm-project/llvm/branches/release_xy -#fetch = :refs/remotes/origin/release_xy -# -# Once the script completes successfully, you can push your changes with -# git-svn dcommit -# -#===------------------------------------------------------------------------===# - - -usage() { - echo "usage: `basename $0` [OPTIONS]" - echo " -rev NUM The revision to merge into the project" -} - -while [ $# -gt 0 ]; do - case $1 in - -rev | --rev | -r ) - shift - rev=$1 - ;; - -h | -help | --help ) - usage - ;; - * ) - echo "unknown option: $1" - echo "" - usage - exit 1 - ;; - esac - shift -done - -if [ -z "$rev" ]; then - echo "error: need to specify a revision" - echo - usage - exit 1 -fi - -# Rebuild revision map -git svn find-rev r$rev origin/master &>/dev/null - -git_hash=`git svn find-rev r$rev origin/master` - -if [ -z "$git_hash" ]; then - echo "error: could not determine git commit for r$rev" - exit 1 -fi - -commit_msg=`svn log -r $rev https://llvm.org/svn/llvm-project/` -ammend="--amend" - -git cherry-pick $git_hash -if [ $? -ne 0 ]; then - echo "" - echo "** cherry-pick failed enter 'e' to exit or 'c' when you have finished resolving the conflicts:" - read option - case $option in - c) - ammend="" - ;; - *) - exit 1 - ;; - esac -fi - -git commit $ammend -m "Merging r$rev:" -m "$commit_msg" diff --git a/utils/release/merge.sh b/utils/release/merge.sh deleted file mode 100755 index ad289b6212c..00000000000 --- a/utils/release/merge.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh -#===-- merge.sh - Test the LLVM release candidates -------------------------===# -# -# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -# See https://llvm.org/LICENSE.txt for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# -#===------------------------------------------------------------------------===# -# -# Merge a revision into a project. -# -#===------------------------------------------------------------------------===# - -set -e - -rev="" -proj="" -revert="no" -srcdir="" - -usage() { - echo "usage: `basename $0` [OPTIONS]" - echo " -proj PROJECT The project to merge the result into" - echo " -rev NUM The revision to merge into the project" - echo " -revert Revert rather than merge the commit" - echo " -srcdir The root of the project checkout" -} - -while [ $# -gt 0 ]; do - case $1 in - -rev | --rev | -r ) - shift - rev=$1 - ;; - -proj | --proj | -project | --project | -p ) - shift - proj=$1 - ;; - --srcdir | -srcdir | -s) - shift - srcdir=$1 - ;; - -h | -help | --help ) - usage - ;; - -revert | --revert ) - revert="yes" - ;; - * ) - echo "unknown option: $1" - echo "" - usage - exit 1 - ;; - esac - shift -done - -if [ -z "$srcdir" ]; then - srcdir="$proj.src" -fi - -if [ "x$rev" = "x" -o "x$proj" = "x" ]; then - echo "error: need to specify project and revision" - echo - usage - exit 1 -fi - -if ! svn ls http://llvm.org/svn/llvm-project/$proj/trunk > /dev/null 2>&1 ; then - echo "error: invalid project: $proj" - exit 1 -fi - -tempfile=`mktemp /tmp/merge.XXXXXX` || exit 1 - -if [ $revert = "yes" ]; then - echo "Reverting r$rev:" > $tempfile -else - echo "Merging r$rev:" > $tempfile -fi -svn log -c $rev http://llvm.org/svn/llvm-project/$proj/trunk >> $tempfile 2>&1 - -cd "$srcdir" -echo "# Updating tree" -svn up - -if [ $revert = "yes" ]; then - echo "# Reverting r$rev in $proj locally" - svn merge -c -$rev . || exit 1 -else - echo "# Merging r$rev into $proj locally" - svn merge -c $rev https://llvm.org/svn/llvm-project/$proj/trunk . || exit 1 -fi - -echo -echo "# To commit, run the following in $srcdir/:" -echo svn commit -F $tempfile - -exit 0 diff --git a/utils/release/tag.sh b/utils/release/tag.sh deleted file mode 100755 index 01922f405ea..00000000000 --- a/utils/release/tag.sh +++ /dev/null @@ -1,145 +0,0 @@ -#!/bin/bash -#===-- tag.sh - Tag the LLVM release candidates ----------------------------===# -# -# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -# See https://llvm.org/LICENSE.txt for license information. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -# -#===------------------------------------------------------------------------===# -# -# Create branches and release candidates for the LLVM release. -# -#===------------------------------------------------------------------------===# - -set -e - -release="" -rc="" -rebranch="no" -# All the projects that make it into the monorepo, plus test-suite. -projects="monorepo-root cfe clang-tools-extra compiler-rt debuginfo-tests libclc libcxx libcxxabi libunwind lld lldb llgo llvm openmp parallel-libs polly pstl test-suite" -dryrun="" -revision="HEAD" - -base_url="https://llvm.org/svn/llvm-project" - -usage() { - echo "usage: `basename $0` -release [-rebranch] [-revision ] [-dry-run]" - echo "usage: `basename $0` -release -rc [-dry-run]" - echo " " - echo " -release The version number of the release" - echo " -rc The release candidate number" - echo " -rebranch Remove existing branch, if present, before branching" - echo " -final Tag final release candidate" - echo " -revision Revision to branch off (default: HEAD)" - echo " -dry-run Make no changes to the repository, just print the commands" -} - -tag_version() { - local remove_args=() - local create_args=() - local message_prefix - set -x - for proj in $projects; do - if svn ls $base_url/$proj/branches/release_$branch_release > /dev/null 2>&1 ; then - if [ $rebranch = "no" ]; then - continue - fi - remove_args+=(rm "$proj/branches/release_$branch_release") - fi - create_args+=(cp ${revision} "$proj/trunk" "$proj/branches/release_$branch_release") - done - if [[ ${#remove_args[@]} -gt 0 ]]; then - message_prefix="Removing and recreating" - else - message_prefix="Creating" - fi - if [[ ${#create_args[@]} -gt 0 ]]; then - ${dryrun} svnmucc --root-url "$base_url" \ - -m "$message_prefix release_$branch_release branch off revision ${revision}" \ - "${remove_args[@]}" "${create_args[@]}" - fi - set +x -} - -tag_release_candidate() { - local create_args=() - set -x - for proj in $projects ; do - if ! svn ls $base_url/$proj/tags/RELEASE_$tag_release > /dev/null 2>&1 ; then - create_args+=(mkdir "$proj/tags/RELEASE_$tag_release") - fi - if ! svn ls $base_url/$proj/tags/RELEASE_$tag_release/$rc > /dev/null 2>&1 ; then - create_args+=(cp HEAD - "$proj/branches/release_$branch_release" - "$proj/tags/RELEASE_$tag_release/$rc") - fi - done - if [[ ${#create_args[@]} -gt 0 ]]; then - ${dryrun} svnmucc --root-url "$base_url" \ - -m "Creating release candidate $rc from release_$tag_release branch" \ - "${create_args[@]}" - fi - set +x -} - -while [ $# -gt 0 ]; do - case $1 in - -release | --release ) - shift - release=$1 - ;; - -rc | --rc ) - shift - rc="rc$1" - ;; - -rebranch | --rebranch ) - rebranch="yes" - ;; - -final | --final ) - rc="final" - ;; - -revision | --revision ) - shift - revision="$1" - ;; - -dry-run | --dry-run ) - dryrun="echo" - ;; - -h | --help | -help ) - usage - exit 0 - ;; - * ) - echo "unknown option: $1" - usage - exit 1 - ;; - esac - shift -done - -if [ "$release" = "" ]; then - echo "error: need to specify a release version" - echo - usage - exit 1 -fi - -branch_release=`echo $release | sed -e 's,\([0-9]*\.[0-9]*\).*,\1,' | sed -e 's,\.,,g'` -tag_release=`echo $release | sed -e 's,\.,,g'` - -if [ "$rc" = "" ]; then - tag_version -else - if [ "$revision" != "HEAD" ]; then - echo "error: cannot use -revision with -rc" - echo - usage - exit 1 - fi - - tag_release_candidate -fi - -exit 0