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

Unified Diff: tools/push-to-trunk.sh

Issue 7886004: push-to-trunk.sh: correctly detect existing branches, git-rm deleted files (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix 80col nit Created 9 years, 3 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/push-to-trunk.sh
diff --git a/tools/push-to-trunk.sh b/tools/push-to-trunk.sh
index 74edbc48fb4a6fc6a4078830e52b28b18493e88d..761b7336794ba9ab8147e497b3924d4b8c5777be 100755
--- a/tools/push-to-trunk.sh
+++ b/tools/push-to-trunk.sh
@@ -74,11 +74,11 @@ confirm() {
}
delete_branch() {
- local MATCH=$(git branch | grep $1)
+ local MATCH=$(git branch | grep $1 | awk '{print $NF}' )
if [ "$MATCH" == "$1" ] ; then
confirm "Branch $1 exists, do you want to delete it?"
if [ $? -eq 0 ] ; then
- git branch -D $1
+ git branch -D $1 || die "Deleting branch '$1' failed."
echo "Branch $1 deleted."
else
die "Can't continue. Please delete branch $1 and try again."
@@ -352,10 +352,17 @@ if [ $STEP -le 13 ] ; then
echo ">>> Step 13: Apply squashed changes."
patch -p1 < "$PATCH_FILE" | tee >(awk '{print $NF}' >> "$TOUCHED_FILES_FILE")
[[ $? -eq 0 ]] || die "Applying the patch to trunk failed."
+ # 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 "$PATCH_FILE"
rm -f "$TOUCHED_FILES_FILE"
fi
« 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