[llvm] r243929 - Add a -revert option to utils/release/merge.sh
Hans Wennborg
hans at hanshq.net
Mon Aug 3 17:47:58 PDT 2015
Author: hans
Date: Mon Aug 3 19:47:58 2015
New Revision: 243929
URL: http://llvm.org/viewvc/llvm-project?rev=243929&view=rev
Log:
Add a -revert option to utils/release/merge.sh
Modified:
llvm/trunk/utils/release/merge.sh
Modified: llvm/trunk/utils/release/merge.sh
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/release/merge.sh?rev=243929&r1=243928&r2=243929&view=diff
==============================================================================
--- llvm/trunk/utils/release/merge.sh (original)
+++ llvm/trunk/utils/release/merge.sh Mon Aug 3 19:47:58 2015
@@ -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
More information about the llvm-commits
mailing list