2 #===-- merge.sh - Test the LLVM release candidates -------------------------===#
4 # The LLVM Compiler Infrastructure
6 # This file is distributed under the University of Illinois Open Source
9 #===------------------------------------------------------------------------===#
11 # Merge a revision into a project.
13 #===------------------------------------------------------------------------===#
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"
28 while [ $# -gt 0 ]; do
34 -proj | --proj | -project | --project | -p )
45 echo "unknown option: $1"
54 if [ "x$rev" = "x" -o "x$proj" = "x" ]; then
55 echo "error: need to specify project and revision"
61 if ! svn ls http://llvm.org/svn/llvm-project/$proj/trunk > /dev/null 2>&1 ; then
62 echo "error: invalid project: $proj"
66 tempfile=`mktemp /tmp/merge.XXXXXX` || exit 1
68 if [ $revert = "yes" ]; then
69 echo "Reverting r$rev:" > $tempfile
71 echo "Merging r$rev:" > $tempfile
73 svn log -c $rev http://llvm.org/svn/llvm-project/$proj/trunk >> $tempfile 2>&1
76 echo "# Updating tree"
79 if [ $revert = "yes" ]; then
80 echo "# Reverting r$rev in $proj locally"
81 svn merge -c -$rev . || exit 1
83 echo "# Merging r$rev into $proj locally"
84 svn merge -c $rev https://llvm.org/svn/llvm-project/$proj/trunk . || exit 1
88 echo "# To commit, run the following in $proj.src/:"
89 echo svn commit -F $tempfile