| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 sane, do so in another shell, but remember to not change the headline of \ | 173 sane, do so in another shell, but remember to not change the headline of \ |
| 174 the uploaded CL." | 174 the uploaded CL." |
| 175 unset ANSWER | 175 unset ANSWER |
| 176 while [ "$ANSWER" != "LGTM" ] ; do | 176 while [ "$ANSWER" != "LGTM" ] ; do |
| 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 wait_for_resolving_conflicts() { |
| 184 echo "Applying the patch failed. Either type \"ABORT<Return>\", or \ |
| 185 resolve the conflicts, stage the touched files with 'git add' and \ |
| 186 type \"RESOLVED<Return>\"" |
| 187 unset ANSWER |
| 188 while [ "$ANSWER" != "RESOLVED" ] ; do |
| 189 [[ "$ANSWER" == "ABORT" ]] && die "Applying the patch failed." |
| 190 [[ -n "$ANSWER" ]] && echo "That was not 'RESOLVED' or 'ABORT'." |
| 191 echo -n "> " |
| 192 read ANSWER |
| 193 done |
| 194 } |
| 195 |
| 183 # Takes a file containing the patch to apply as first argument. | 196 # Takes a file containing the patch to apply as first argument. |
| 184 apply_patch() { | 197 apply_patch() { |
| 185 patch $REVERSE_PATCH -p1 < "$1" > "$PATCH_OUTPUT_FILE" || \ | 198 patch $REVERSE_PATCH -p1 < "$1" > "$PATCH_OUTPUT_FILE" || \ |
| 186 { cat "$PATCH_OUTPUT_FILE" && die "Applying the patch failed."; } | 199 { cat "$PATCH_OUTPUT_FILE" && wait_for_resolving_conflicts; } |
| 187 tee < "$PATCH_OUTPUT_FILE" >(grep "patching file" \ | 200 tee < "$PATCH_OUTPUT_FILE" >(grep "patching file" \ |
| 188 | awk '{print $NF}' >> "$TOUCHED_FILES_FILE") | 201 | awk '{print $NF}' >> "$TOUCHED_FILES_FILE") |
| 189 rm "$PATCH_OUTPUT_FILE" | 202 rm "$PATCH_OUTPUT_FILE" |
| 190 } | 203 } |
| 191 | 204 |
| 192 stage_files() { | 205 stage_files() { |
| 193 # Stage added and modified files. | 206 # Stage added and modified files. |
| 194 TOUCHED_FILES=$(cat "$TOUCHED_FILES_FILE") | 207 TOUCHED_FILES=$(cat "$TOUCHED_FILES_FILE") |
| 195 for FILE in $TOUCHED_FILES ; do | 208 for FILE in $TOUCHED_FILES ; do |
| 196 git add "$FILE" | 209 git add "$FILE" |
| 197 done | 210 done |
| 198 # Stage deleted files. | 211 # Stage deleted files. |
| 199 DELETED_FILES=$(git status -s -uno --porcelain | grep "^ D" \ | 212 DELETED_FILES=$(git status -s -uno --porcelain | grep "^ D" \ |
| 200 | awk '{print $NF}') | 213 | awk '{print $NF}') |
| 201 for FILE in $DELETED_FILES ; do | 214 for FILE in $DELETED_FILES ; do |
| 202 git rm "$FILE" | 215 git rm "$FILE" |
| 203 done | 216 done |
| 204 rm -f "$TOUCHED_FILES_FILE" | 217 rm -f "$TOUCHED_FILES_FILE" |
| 205 } | 218 } |
| OLD | NEW |