diff options
Diffstat (limited to 'utils/release/merge.sh')
-rwxr-xr-x | utils/release/merge.sh | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/utils/release/merge.sh b/utils/release/merge.sh index 949c29837813..93e08c7ce135 100755 --- a/utils/release/merge.sh +++ b/utils/release/merge.sh @@ -16,11 +16,13 @@ set -e rev="" proj="" +revert="no" function 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" } while [ $# -gt 0 ]; do @@ -36,6 +38,9 @@ while [ $# -gt 0 ]; do -h | -help | --help ) usage ;; + -revert | --revert ) + revert="yes" + ;; * ) echo "unknown option: $1" echo "" @@ -60,17 +65,27 @@ fi tempfile=`mktemp /tmp/merge.XXXXXX` || exit 1 -echo "Merging r$rev:" > $tempfile +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 $proj.src echo "# Updating tree" svn up -echo "# Merging r$rev into $proj locally" -svn merge -c $rev https://llvm.org/svn/llvm-project/$proj/trunk . || exit 1 + +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 the merge, run the following in $proj.src/:" +echo "# To commit, run the following in $proj.src/:" echo svn commit -F $tempfile exit 0 |