Revision: 11142
Author:   [email protected]
Date:     Mon Mar 26 04:35:17 2012
Log:      Support reverse patching in merge-to-branch.sh

[email protected]

Review URL: https://chromiumcodereview.appspot.com/9839056
http://code.google.com/p/v8/source/detail?r=11142

Modified:
 /branches/bleeding_edge/tools/common-includes.sh
 /branches/bleeding_edge/tools/merge-to-branch.sh

=======================================
--- /branches/bleeding_edge/tools/common-includes.sh Mon Mar 19 03:16:38 2012 +++ /branches/bleeding_edge/tools/common-includes.sh Mon Mar 26 04:35:17 2012
@@ -175,7 +175,7 @@

 # Takes a file containing the patch to apply as first argument.
 apply_patch() {
-  patch -p1 < "$1" > "$PATCH_OUTPUT_FILE" || \
+  patch $REVERSE_PATCH -p1 < "$1" > "$PATCH_OUTPUT_FILE" || \
     { cat "$PATCH_OUTPUT_FILE" && die "Applying the patch failed."; }
   tee < "$PATCH_OUTPUT_FILE" >(awk '{print $NF}' >> "$TOUCHED_FILES_FILE")
   rm "$PATCH_OUTPUT_FILE"
=======================================
--- /branches/bleeding_edge/tools/merge-to-branch.sh Fri Mar 23 04:54:07 2012 +++ /branches/bleeding_edge/tools/merge-to-branch.sh Mon Mar 26 04:35:17 2012
@@ -49,6 +49,7 @@
   -h    Show this message
   -s    Specify the step where to start work. Default: 0.
   -p    Specify a patch file to apply as part of the merge
+  -r    Reverse specified patches
 EOF
 }

@@ -68,7 +69,7 @@

 ########## Option parsing

-while getopts ":hs:fp:" OPTION ; do
+while getopts ":hs:fp:r" OPTION ; do
   case $OPTION in
     h)  usage
         exit 0
@@ -77,6 +78,8 @@
         ;;
     f)  rm -f "$ALREADY_MERGING_SENTINEL_FILE"
         ;;
+    r)  REVERSE_PATCH="--reverse"
+        ;;
     s)  START_STEP=$OPTARG
         ;;
     ?)  echo "Illegal option: -$OPTARG"
@@ -134,7 +137,11 @@
   if [ -z "$REVISION_LIST" ] ; then
     NEW_COMMIT_MSG="Applied patch to $MERGE_TO_BRANCH branch."
   else
-    NEW_COMMIT_MSG="Merged$REVISION_LIST into $MERGE_TO_BRANCH branch."
+    if [ -n "$REVERSE_PATCH" ] ; then
+ NEW_COMMIT_MSG="Rollback of$REVISION_LIST in $MERGE_TO_BRANCH branch."
+    else
+      NEW_COMMIT_MSG="Merged$REVISION_LIST into $MERGE_TO_BRANCH branch."
+    fi;
   fi;

   echo "$NEW_COMMIT_MSG" > $COMMITMSG_FILE

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to