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

Side by Side Diff: tools/merge-to-branch.sh

Issue 185653004: Experimental parser: merge to r19637 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 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 | « tools/lexer_generator/code_generator.jinja ('k') | tools/push-to-trunk/auto_roll.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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."
187 restore_if_unset "FULL_REVISION_LIST"
144 current=0 188 current=0
145 for REVISION in "$@" ; do 189 for REVISION in $FULL_REVISION_LIST ; do
146 NEXT_HASH=$(git svn find-rev "r$REVISION" svn/bleeding_edge) 190 NEXT_HASH=$(git svn find-rev "r$REVISION" svn/bleeding_edge)
147 [[ -n "$NEXT_HASH" ]] \ 191 [[ -n "$NEXT_HASH" ]] \
148 || die "Cannot determine git hash for r$REVISION" 192 || die "Cannot determine git hash for r$REVISION"
149 PATCH_COMMIT_HASHES[$current]="$NEXT_HASH" 193 PATCH_COMMIT_HASHES[$current]="$NEXT_HASH"
150 [[ -n "$REVISION_LIST" ]] && REVISION_LIST="$REVISION_LIST," 194 [[ -n "$REVISION_LIST" ]] && REVISION_LIST="$REVISION_LIST,"
151 REVISION_LIST="$REVISION_LIST r$REVISION" 195 REVISION_LIST="$REVISION_LIST r$REVISION"
152 let current+=1 196 let current+=1
153 done 197 done
154 if [ -n "$REVISION_LIST" ] ; then 198 if [ -n "$REVISION_LIST" ] ; then
155 if [ -n "$REVERSE_PATCH" ] ; then 199 if [ -n "$REVERSE_PATCH" ] ; then
(...skipping 28 matching lines...) Expand all
184 persist "NEW_COMMIT_MSG" 228 persist "NEW_COMMIT_MSG"
185 persist "REVISION_LIST" 229 persist "REVISION_LIST"
186 persist_patch_commit_hashes 230 persist_patch_commit_hashes
187 fi 231 fi
188 232
189 let CURRENT_STEP+=1 233 let CURRENT_STEP+=1
190 if [ $START_STEP -le $CURRENT_STEP ] ; then 234 if [ $START_STEP -le $CURRENT_STEP ] ; then
191 echo ">>> Step $CURRENT_STEP: Apply patches for selected revisions." 235 echo ">>> Step $CURRENT_STEP: Apply patches for selected revisions."
192 restore_if_unset "MERGE_TO_BRANCH" 236 restore_if_unset "MERGE_TO_BRANCH"
193 restore_patch_commit_hashes_if_unset "PATCH_COMMIT_HASHES" 237 restore_patch_commit_hashes_if_unset "PATCH_COMMIT_HASHES"
194 rm -f "$TOUCHED_FILES_FILE"
195 for HASH in ${PATCH_COMMIT_HASHES[@]} ; do 238 for HASH in ${PATCH_COMMIT_HASHES[@]} ; do
196 echo "Applying patch for $HASH to $MERGE_TO_BRANCH..." 239 echo "Applying patch for $HASH to $MERGE_TO_BRANCH..."
197 git log -1 -p $HASH > "$TEMPORARY_PATCH_FILE" 240 git log -1 -p $HASH > "$TEMPORARY_PATCH_FILE"
198 apply_patch "$TEMPORARY_PATCH_FILE" 241 apply_patch "$TEMPORARY_PATCH_FILE"
199 done 242 done
200 if [ -n "$EXTRA_PATCH" ] ; then 243 if [ -n "$EXTRA_PATCH" ] ; then
201 apply_patch "$EXTRA_PATCH" 244 apply_patch "$EXTRA_PATCH"
202 fi 245 fi
203 fi 246 fi
204 247
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « tools/lexer_generator/code_generator.jinja ('k') | tools/push-to-trunk/auto_roll.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698