Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Unified Diff: tools/merge-to-branch.sh

Issue 10538056: Merged r11546 into 3.9 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.9
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/common-includes.sh ('k') | tools/presubmit.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/merge-to-branch.sh
diff --git a/tools/merge-to-branch.sh b/tools/merge-to-branch.sh
old mode 100644
new mode 100755
index 49bf3e44896cefdb3d90d79d42276e87bcb19bbd..aa590a313ca096311e1d1b81c3b51087895e28ea
--- a/tools/merge-to-branch.sh
+++ b/tools/merge-to-branch.sh
@@ -49,6 +49,8 @@ OPTIONS:
-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
+ -m Specify a commit message for the patch
+ -r Reverse specified patches
EOF
}
@@ -68,7 +70,7 @@ restore_patch_commit_hashes_if_unset() {
########## Option parsing
-while getopts ":hs:fp:" OPTION ; do
+while getopts ":hs:fp:rm:" OPTION ; do
case $OPTION in
h) usage
exit 0
@@ -77,6 +79,10 @@ while getopts ":hs:fp:" OPTION ; do
;;
f) rm -f "$ALREADY_MERGING_SENTINEL_FILE"
;;
+ r) REVERSE_PATCH="--reverse"
+ ;;
+ m) NEW_COMMIT_MSG=$OPTARG
+ ;;
s) START_STEP=$OPTARG
;;
?) echo "Illegal option: -$OPTARG"
@@ -98,8 +104,13 @@ touch "$ALREADY_MERGING_SENTINEL_FILE"
initial_environment_checks
if [ $START_STEP -le $CURRENT_STEP ] ; then
- if [ ${#@} -lt 2 ] && [ -z "$EXTRA_PATCH" ] ; then
- die "Either a patch file or revision numbers must be specified"
+ if [ ${#@} -lt 2 ] ; then
+ if [ -z "$EXTRA_PATCH" ] ; then
+ die "Either a patch file or revision numbers must be specified"
+ fi
+ if [ -z "$NEW_COMMIT_MSG" ] ; then
+ die "You must specify a merge comment if no patches are specified"
+ fi
fi
echo ">>> Step $CURRENT_STEP: Preparation"
MERGE_TO_BRANCH=$1
@@ -131,10 +142,12 @@ revisions associated with the patches."
REVISION_LIST="$REVISION_LIST r$REVISION"
let current+=1
done
- 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 "$REVISION_LIST" ] ; then
+ 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
« no previous file with comments | « tools/common-includes.sh ('k') | tools/presubmit.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698