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

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

Issue 9315055: merge-to-branch.sh should correctly handle added/deleted files (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 11 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 | « no previous file | no next file » | 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
index ef7cee4b38227f3e0fcd22c64750159e81db29c8..1154e56305c4de570e2a757be65679b906e3420e 100755
--- a/tools/merge-to-branch.sh
+++ b/tools/merge-to-branch.sh
@@ -233,11 +233,25 @@ if [ $START_STEP -le $CURRENT_STEP ] ; then
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 "Applying the patch to trunk failed."
Jakob Kummerow 2012/02/02 13:45:54 Your previous error message was more fitting (or u
danno 2012/02/07 22:51:37 Done.
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698