Reviewers: Paul Lind, kisg, kilvadyb, dusmil, danno, Jakob, Michael Achenbach,

Message:
This CL adds an additional step to the merge-to-branch.sh, which tries to find all corresponding MIPS ports. If the MIPS ports are already included, then it stays silent. Otherwise, it asks if it should add the missing MIPS ports to the
revision list.

Example usage:
$ tools/merge-to-branch.sh 3.23 18958
Step 0: Preparation
Step 1: Create a fresh branch for the patch.
Switched to a new branch 'prepare-merge'
Step 2: Search for corresponding MIPS ports.
Found MIPS port of r18958 -> r18968: MIPS: Fix the context check in
LoadGlobalFunctionPrototype
Automatically add corresponding MIPS ports (18968)? [Y/n]
Step 3: Find the git revisions associated with the patches.
Step 4: Apply patches for selected revisions.

Or, when the MIPS ports are included:
$ tools/merge-to-branch.sh 3.23 18958 18968
Step 0: Preparation
Step 1: Create a fresh branch for the patch.
Switched to a new branch 'prepare-merge'
Step 2: Search for corresponding MIPS ports.
Found MIPS port of r18958 -> r18968 (already included): MIPS: Fix the context
check in LoadGlobalFunctionPrototype
Step 3: Find the git revisions associated with the patches.
Step 4: Apply patches for selected revisions.

Or:
$ tools/merge-to-branch.sh 3.23 18958 18968 18627
Step 0: Preparation
Step 1: Create a fresh branch for the patch.
Switched to a new branch 'prepare-merge'
Step 2: Search for corresponding MIPS ports.
Found MIPS port of r18958 -> r18968 (already included): MIPS: Fix the context
check in LoadGlobalFunctionPrototype
Found MIPS port of r18627 -> r18631: MIPS: Fix Win32 buildbreak (caused by
overriden methods that have disappeared while having the patch out for code
review).
Automatically add corresponding MIPS ports (18631)? [Y/n]
Step 3: Find the git revisions associated with the patches.
Step 4: Apply patches for selected revisions.

Description:
Add support to automatically search for corresponding MIPS ports in
merge-to-branch.sh.

BUG=

Please review this at https://codereview.chromium.org/152343011/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+35, -1 lines):
  M tools/merge-to-branch.sh


Index: tools/merge-to-branch.sh
diff --git a/tools/merge-to-branch.sh b/tools/merge-to-branch.sh
index 175567e97fed58a7fd18207300ee1e7d628feb03..7336c6fc4ed29701df84de66f5191122cd722cc5 100755
--- a/tools/merge-to-branch.sh
+++ b/tools/merge-to-branch.sh
@@ -139,10 +139,44 @@ fi

 let CURRENT_STEP+=1
 if [ $START_STEP -le $CURRENT_STEP ] ; then
+  echo ">>> Step $CURRENT_STEP: Search for corresponding MIPS ports."
+  for REVISION in "$@" ; do
+ MIPS_GIT_HASH=$(git log svn/bleeding_edge -1 --format=%H --grep="Port r$REVISION")
+    if [ "$MIPS_GIT_HASH" != "" ] ; then
+ MIPS_SVN_REVISION=$(git svn find-rev $MIPS_GIT_HASH svn/bleeding_edge)
+      if [ $? -eq 0 ] ; then
+ FULL_REVISION_LIST=("${FULL_REVISION_LIST[@]}" "$REVISION" "$MIPS_SVN_REVISION")
+        MIPS_REVISION_TITLE=$(git log -1 --format=%s $MIPS_GIT_HASH)
+        # Is this revision included in the original revision list?
+        if [[ $@ =~ (^| )$MIPS_SVN_REVISION($| ) ]] ; then
+          echo "Found MIPS port of r$REVISION -> \
+r$MIPS_SVN_REVISION (already included): $MIPS_REVISION_TITLE"
+        else
+          echo "Found MIPS port of r$REVISION -> \
+r$MIPS_SVN_REVISION: $MIPS_REVISION_TITLE"
+ MIPS_REVISION_LIST=("${MIPS_REVISION_LIST[@]}" "$MIPS_SVN_REVISION")
+        fi
+      fi
+    fi
+  done
+  # Next step expects a list, not an array.
+  FULL_REVISION_LIST="${FULL_REVISION_LIST[@]}"
+  # Do we find any MIPS port?
+  if [ ${#MIPS_REVISION_LIST[@]} -ne 0 ] ; then
+ confirm "Automatically add corresponding MIPS ports (${MIPS_REVISION_LIST[@]})?"
+    #: 'n': Restore the original revision list.
+    if [ $? -ne 0 ] ; then
+      FULL_REVISION_LIST="$@"
+    fi
+  fi
+fi
+
+let CURRENT_STEP+=1
+if [ $START_STEP -le $CURRENT_STEP ] ; then
   echo ">>> Step $CURRENT_STEP: Find the git \
 revisions associated with the patches."
   current=0
-  for REVISION in "$@" ; do
+  for REVISION in $FULL_REVISION_LIST ; do
     NEXT_HASH=$(git svn find-rev "r$REVISION" svn/bleeding_edge)
     [[ -n "$NEXT_HASH" ]] \
       || die "Cannot determine git hash for r$REVISION"


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to