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

Side by Side Diff: tools/common-includes.sh

Issue 9839056: Support reverse patching in merge-to-branch.sh (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/merge-to-branch.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2012 the V8 project authors. All rights reserved. 1 # Copyright 2012 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without 2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are 3 # modification, are permitted provided that the following conditions are
4 # met: 4 # met:
5 # 5 #
6 # * Redistributions of source code must retain the above copyright 6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above 8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following 9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided 10 # disclaimer in the documentation and/or other materials provided
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 unset ANSWER 168 unset ANSWER
169 while [ "$ANSWER" != "LGTM" ] ; do 169 while [ "$ANSWER" != "LGTM" ] ; do
170 [[ -n "$ANSWER" ]] && echo "That was not 'LGTM'." 170 [[ -n "$ANSWER" ]] && echo "That was not 'LGTM'."
171 echo -n "> " 171 echo -n "> "
172 read ANSWER 172 read ANSWER
173 done 173 done
174 } 174 }
175 175
176 # Takes a file containing the patch to apply as first argument. 176 # Takes a file containing the patch to apply as first argument.
177 apply_patch() { 177 apply_patch() {
178 patch -p1 < "$1" > "$PATCH_OUTPUT_FILE" || \ 178 patch $REVERSE_PATCH -p1 < "$1" > "$PATCH_OUTPUT_FILE" || \
179 { cat "$PATCH_OUTPUT_FILE" && die "Applying the patch failed."; } 179 { cat "$PATCH_OUTPUT_FILE" && die "Applying the patch failed."; }
180 tee < "$PATCH_OUTPUT_FILE" >(awk '{print $NF}' >> "$TOUCHED_FILES_FILE") 180 tee < "$PATCH_OUTPUT_FILE" >(awk '{print $NF}' >> "$TOUCHED_FILES_FILE")
181 rm "$PATCH_OUTPUT_FILE" 181 rm "$PATCH_OUTPUT_FILE"
182 } 182 }
183 183
184 stage_files() { 184 stage_files() {
185 # Stage added and modified files. 185 # Stage added and modified files.
186 TOUCHED_FILES=$(cat "$TOUCHED_FILES_FILE") 186 TOUCHED_FILES=$(cat "$TOUCHED_FILES_FILE")
187 for FILE in $TOUCHED_FILES ; do 187 for FILE in $TOUCHED_FILES ; do
188 git add "$FILE" 188 git add "$FILE"
189 done 189 done
190 # Stage deleted files. 190 # Stage deleted files.
191 DELETED_FILES=$(git status -s -uno --porcelain | grep "^ D" \ 191 DELETED_FILES=$(git status -s -uno --porcelain | grep "^ D" \
192 | awk '{print $NF}') 192 | awk '{print $NF}')
193 for FILE in $DELETED_FILES ; do 193 for FILE in $DELETED_FILES ; do
194 git rm "$FILE" 194 git rm "$FILE"
195 done 195 done
196 rm -f "$TOUCHED_FILES_FILE" 196 rm -f "$TOUCHED_FILES_FILE"
197 } 197 }
OLDNEW
« no previous file with comments | « no previous file | tools/merge-to-branch.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698