| OLD | NEW |
| 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 [[ -n "$ANSWER" ]] && echo "That was not 'LGTM'." | 177 [[ -n "$ANSWER" ]] && echo "That was not 'LGTM'." |
| 178 echo -n "> " | 178 echo -n "> " |
| 179 read ANSWER | 179 read ANSWER |
| 180 done | 180 done |
| 181 } | 181 } |
| 182 | 182 |
| 183 # Takes a file containing the patch to apply as first argument. | 183 # Takes a file containing the patch to apply as first argument. |
| 184 apply_patch() { | 184 apply_patch() { |
| 185 patch $REVERSE_PATCH -p1 < "$1" > "$PATCH_OUTPUT_FILE" || \ | 185 patch $REVERSE_PATCH -p1 < "$1" > "$PATCH_OUTPUT_FILE" || \ |
| 186 { cat "$PATCH_OUTPUT_FILE" && die "Applying the patch failed."; } | 186 { cat "$PATCH_OUTPUT_FILE" && die "Applying the patch failed."; } |
| 187 tee < "$PATCH_OUTPUT_FILE" >(awk '{print $NF}' >> "$TOUCHED_FILES_FILE") | 187 tee < "$PATCH_OUTPUT_FILE" >(grep "patching file" \ |
| 188 | awk '{print $NF}' >> "$TOUCHED_FILES_FILE") |
| 188 rm "$PATCH_OUTPUT_FILE" | 189 rm "$PATCH_OUTPUT_FILE" |
| 189 } | 190 } |
| 190 | 191 |
| 191 stage_files() { | 192 stage_files() { |
| 192 # Stage added and modified files. | 193 # Stage added and modified files. |
| 193 TOUCHED_FILES=$(cat "$TOUCHED_FILES_FILE") | 194 TOUCHED_FILES=$(cat "$TOUCHED_FILES_FILE") |
| 194 for FILE in $TOUCHED_FILES ; do | 195 for FILE in $TOUCHED_FILES ; do |
| 195 git add "$FILE" | 196 git add "$FILE" |
| 196 done | 197 done |
| 197 # Stage deleted files. | 198 # Stage deleted files. |
| 198 DELETED_FILES=$(git status -s -uno --porcelain | grep "^ D" \ | 199 DELETED_FILES=$(git status -s -uno --porcelain | grep "^ D" \ |
| 199 | awk '{print $NF}') | 200 | awk '{print $NF}') |
| 200 for FILE in $DELETED_FILES ; do | 201 for FILE in $DELETED_FILES ; do |
| 201 git rm "$FILE" | 202 git rm "$FILE" |
| 202 done | 203 done |
| 203 rm -f "$TOUCHED_FILES_FILE" | 204 rm -f "$TOUCHED_FILES_FILE" |
| 204 } | 205 } |
| OLD | NEW |