2 #===-- merge.sh - Test the LLVM release candidates -------------------------===#
4 # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 # See https://llvm.org/LICENSE.txt for license information.
6 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 #===------------------------------------------------------------------------===#
10 # Merge a revision into a project.
12 #===------------------------------------------------------------------------===#
22 echo "usage: `basename $0` [OPTIONS]"
23 echo " -proj PROJECT The project to merge the result into"
24 echo " -rev NUM The revision to merge into the project"
25 echo " -revert Revert rather than merge the commit"
26 echo " -srcdir The root of the project checkout"
29 while [ $# -gt 0 ]; do
35 -proj |
--proj |
-project |
--project |
-p )
39 --srcdir |
-srcdir |
-s)
50 echo "unknown option: $1"
59 if [ -z "$srcdir" ]; then
63 if [ "x$rev" = "x" -o "x$proj" = "x" ]; then
64 echo "error: need to specify project and revision"
70 if ! svn
ls http
://llvm.org
/svn
/llvm-project
/$proj/trunk
> /dev
/null
2>&1 ; then
71 echo "error: invalid project: $proj"
75 tempfile
=`mktemp /tmp/merge.XXXXXX` ||
exit 1
77 if [ $revert = "yes" ]; then
78 echo "Reverting r$rev:" > $tempfile
80 echo "Merging r$rev:" > $tempfile
82 svn log
-c $rev http
://llvm.org
/svn
/llvm-project
/$proj/trunk
>> $tempfile 2>&1
85 echo "# Updating tree"
88 if [ $revert = "yes" ]; then
89 echo "# Reverting r$rev in $proj locally"
90 svn merge
-c -$rev . ||
exit 1
92 echo "# Merging r$rev into $proj locally"
93 svn merge
-c $rev https
://llvm.org
/svn
/llvm-project
/$proj/trunk . ||
exit 1
97 echo "# To commit, run the following in $srcdir/:"
98 echo svn commit
-F $tempfile