Revision: 10592
Author:   [email protected]
Date:     Thu Feb  2 05:51:05 2012
Log:      merge-to-branch.sh should correctly handle added/deleted files

[email protected]

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

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

=======================================
--- /branches/bleeding_edge/tools/merge-to-branch.sh Tue Jan 31 03:17:17 2012 +++ /branches/bleeding_edge/tools/merge-to-branch.sh Thu Feb 2 05:51:05 2012
@@ -233,11 +233,26 @@
   restore_if_unset "MERGE_TO_BRANCH"
   restore_patch_commit_hashes_if_unset "PATCH_COMMIT_HASHES"
   echo "${PATCH_COMMIT_HASHES[@]}"
- echo ">>> Step $CURRENT_STEP: Apply the revision patch and create commit message."
+  echo ">>> Step $CURRENT_STEP: Apply patches for selected revisions."
+  rm -f "$TOUCHED_FILES_FILE"
   for HASH in ${PATCH_COMMIT_HASHES[@]} ; do
     git log -1 -p $HASH | patch -p1 \
-      || die "Cannot apply the patch for $HASH to $MERGE_TO_BRANCH"
+      | tee >(awk '{print $NF}' >> "$TOUCHED_FILES_FILE")
+    [[ $? -eq 0 ]] \
+      || die "Cannot apply the patch for $HASH to $MERGE_TO_BRANCH."
   done
+  # Stage added and modified files.
+  TOUCHED_FILES=$(cat "$TOUCHED_FILES_FILE")
+  for FILE in $TOUCHED_FILES ; do
+    git add "$FILE"
+  done
+  # Stage deleted files.
+  DELETED_FILES=$(git status -s -uno --porcelain | grep "^ D" \
+                                                 | awk '{print $NF}')
+  for FILE in $DELETED_FILES ; do
+    git rm "$FILE"
+  done
+  rm -f "$TOUCHED_FILES_FILE"
 fi

 let CURRENT_STEP+=1

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

Reply via email to