Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright 2012 the V8 project authors. All rights reserved. | 2 # Copyright 2012 the V8 project authors. All rights reserved. |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following | 10 # copyright notice, this list of conditions and the following |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 132 let CURRENT_STEP+=1 | 132 let CURRENT_STEP+=1 |
| 133 if [ $START_STEP -le $CURRENT_STEP ] ; then | 133 if [ $START_STEP -le $CURRENT_STEP ] ; then |
| 134 echo ">>> Step $CURRENT_STEP: Create a fresh branch for the patch." | 134 echo ">>> Step $CURRENT_STEP: Create a fresh branch for the patch." |
| 135 restore_if_unset "MERGE_TO_BRANCH" | 135 restore_if_unset "MERGE_TO_BRANCH" |
| 136 git checkout -b $BRANCHNAME svn/$MERGE_TO_BRANCH \ | 136 git checkout -b $BRANCHNAME svn/$MERGE_TO_BRANCH \ |
| 137 || die "Creating branch $BRANCHNAME failed." | 137 || die "Creating branch $BRANCHNAME failed." |
| 138 fi | 138 fi |
| 139 | 139 |
| 140 let CURRENT_STEP+=1 | 140 let CURRENT_STEP+=1 |
| 141 if [ $START_STEP -le $CURRENT_STEP ] ; then | 141 if [ $START_STEP -le $CURRENT_STEP ] ; then |
| 142 echo ">>> Step $CURRENT_STEP: Search for corresponding architecture ports." | |
| 143 for REVISION in "$@" ; do | |
| 144 # Add the revision to the array if it isn't already added. | |
| 145 if [[ ! "${FULL_REVISION_LIST[@]}" =~ (^| )$REVISION($| ) ]] ; then | |
| 146 FULL_REVISION_LIST=("${FULL_REVISION_LIST[@]}" "$REVISION") | |
| 147 fi | |
| 148 # Search for commits which matches the "Port rXXX" pattern. | |
| 149 GIT_HASHES=$(git log svn/bleeding_edge --reverse \ | |
| 150 --format=%H --grep="Port r$REVISION") | |
| 151 if [ -n "$GIT_HASHES" ]; then | |
| 152 while read -r NEXT_GIT_HASH; do | |
|
Jakob Kummerow
2014/02/06 09:30:26
for consistency with other loops, can we just use:
palfia
2014/02/06 14:12:03
The problem here is that the "git log" command ret
| |
| 153 NEXT_SVN_REVISION=$(git svn find-rev $NEXT_GIT_HASH svn/bleeding_edge) | |
| 154 [[ -n "$NEXT_SVN_REVISION" ]] \ | |
| 155 || die "Cannot determine svn revision for $NEXT_GIT_HASH" | |
| 156 FULL_REVISION_LIST=("${FULL_REVISION_LIST[@]}" "$NEXT_SVN_REVISION") | |
| 157 REVISION_TITLE=$(git log -1 --format=%s $NEXT_GIT_HASH) | |
| 158 # Is this revision included in the original revision list? | |
| 159 if [[ $@ =~ (^| )$NEXT_SVN_REVISION($| ) ]] ; then | |
| 160 echo "Found port of r$REVISION -> \ | |
| 161 r$NEXT_SVN_REVISION (already included): $REVISION_TITLE" | |
| 162 else | |
| 163 echo "Found port of r$REVISION -> \ | |
| 164 r$NEXT_SVN_REVISION: $REVISION_TITLE" | |
| 165 PORT_REVISION_LIST=("${PORT_REVISION_LIST[@]}" "$NEXT_SVN_REVISION") | |
| 166 fi | |
| 167 done <<< "$GIT_HASHES" | |
| 168 fi | |
| 169 done | |
| 170 # Next step expects a list, not an array. | |
| 171 FULL_REVISION_LIST="${FULL_REVISION_LIST[@]}" | |
| 172 # Do we find any port? | |
| 173 if [ ${#PORT_REVISION_LIST[@]} -ne 0 ] ; then | |
| 174 confirm "Automatically add corresponding ports (${PORT_REVISION_LIST[*]})?" | |
| 175 #: 'n': Restore the original revision list. | |
| 176 if [ $? -ne 0 ] ; then | |
| 177 FULL_REVISION_LIST="$@" | |
| 178 fi | |
| 179 fi | |
| 180 persist "FULL_REVISION_LIST" | |
| 181 fi | |
| 182 | |
| 183 let CURRENT_STEP+=1 | |
| 184 if [ $START_STEP -le $CURRENT_STEP ] ; then | |
| 142 echo ">>> Step $CURRENT_STEP: Find the git \ | 185 echo ">>> Step $CURRENT_STEP: Find the git \ |
| 143 revisions associated with the patches." | 186 revisions associated with the patches." |
| 144 current=0 | 187 current=0 |
| 145 for REVISION in "$@" ; do | 188 for REVISION in $FULL_REVISION_LIST ; do |
|
Jakob Kummerow
2014/02/06 09:30:26
Before using this variable in a new step, please a
palfia
2014/02/06 14:12:03
Thanks, done.
| |
| 146 NEXT_HASH=$(git svn find-rev "r$REVISION" svn/bleeding_edge) | 189 NEXT_HASH=$(git svn find-rev "r$REVISION" svn/bleeding_edge) |
| 147 [[ -n "$NEXT_HASH" ]] \ | 190 [[ -n "$NEXT_HASH" ]] \ |
| 148 || die "Cannot determine git hash for r$REVISION" | 191 || die "Cannot determine git hash for r$REVISION" |
| 149 PATCH_COMMIT_HASHES[$current]="$NEXT_HASH" | 192 PATCH_COMMIT_HASHES[$current]="$NEXT_HASH" |
| 150 [[ -n "$REVISION_LIST" ]] && REVISION_LIST="$REVISION_LIST," | 193 [[ -n "$REVISION_LIST" ]] && REVISION_LIST="$REVISION_LIST," |
| 151 REVISION_LIST="$REVISION_LIST r$REVISION" | 194 REVISION_LIST="$REVISION_LIST r$REVISION" |
| 152 let current+=1 | 195 let current+=1 |
| 153 done | 196 done |
| 154 if [ -n "$REVISION_LIST" ] ; then | 197 if [ -n "$REVISION_LIST" ] ; then |
| 155 if [ -n "$REVERSE_PATCH" ] ; then | 198 if [ -n "$REVERSE_PATCH" ] ; then |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 290 restore_version_if_unset "NEW" | 333 restore_version_if_unset "NEW" |
| 291 common_cleanup | 334 common_cleanup |
| 292 if [ $REVERT_FROM_BLEEDING_EDGE==0 ] ; then | 335 if [ $REVERT_FROM_BLEEDING_EDGE==0 ] ; then |
| 293 echo "*** SUMMARY ***" | 336 echo "*** SUMMARY ***" |
| 294 echo "version: $NEWMAJOR.$NEWMINOR.$NEWBUILD.$NEWPATCH" | 337 echo "version: $NEWMAJOR.$NEWMINOR.$NEWBUILD.$NEWPATCH" |
| 295 echo "branch: $TO_URL" | 338 echo "branch: $TO_URL" |
| 296 echo "svn revision: $SVN_REVISION" | 339 echo "svn revision: $SVN_REVISION" |
| 297 [[ -n "$REVISION_LIST" ]] && echo "patches:$REVISION_LIST" | 340 [[ -n "$REVISION_LIST" ]] && echo "patches:$REVISION_LIST" |
| 298 fi | 341 fi |
| 299 fi | 342 fi |
| OLD | NEW |