#!/usr/bin/env bash set -e # Requirements: # sudo apt-get install xclip # e.g. 1908 ROLL # ./start_dartium_roll.sh --verbose --directory ~/dartium-roll --old-branch 1847 --old-revision 251904 --new-branch 1908 --new-revision 259084 --chrome --pre-roll # ./start_dartium_roll.sh --verbose --directory ~/dartium-roll --old-branch 1847 --old-revision 251904 --new-branch 1908 --new-revision 259084 --chrome --roll # ./start_dartium_roll.sh --verbose --directory ~/dartium-roll --old-branch 1847 --old-revision 251904 --new-branch 1908 --new-revision 259084 --chrome --info # ./start_dartium_roll.sh --verbose --directory ~/dartium-roll --old-branch 1847 --old-revision 167304 --new-branch 1908 --new-revision 169907 --blink --pre-roll # ./start_dartium_roll.sh --verbose --directory ~/dartium-roll --old-branch 1847 --old-revision 167304 --new-branch 1908 --new-revision 169907 --blink --roll # ./start_dartium_roll.sh --verbose --directory ~/dartium-roll --old-branch 1847 --old-revision 167304 --new-branch 1908 --new-revision 169907 --blink --info # e.g., 1916 ROLL # ~/./start_dartium_roll.sh --verbose --directory /media/TB/dartium-1916 --old-branch 1908 --old-revision 259084 --new-branch 1916 --new-revision 260298 --chrome --pre-roll # ~/./start_dartium_roll.sh --verbose --directory /media/TB/dartium-1916 --old-branch 1908 --old-revision 169907 --new-branch 1916 --new-revision 170313 --blink --pre-roll global E_INVALID_ARG := '128' proc usage { echo "Usage: $0 [--options]" echo "Options:" echo " --[no-]verbose: display information about each step" echo " --directory base: base directory of local git repository" echo " (e.g., ~/dartium-roll implies directory" echo " ~/dartium-roll/src and" echo " ~/dartium-roll/src/third_party/WebKit)**" echo " --chrome: for the Chrome branch (not with --blink)**" echo " --blink: for the Blink branch (not with --chrome)**" echo " --old-branch name: name of previous true branch (e.g., use 1847" echo " for version 34.0.1847.92) *" echo " --old-revision revision: revision of base trunk for $OLD version *" echo " --new-branch name: name of new true branch to create *" echo " --new-revision revision: revision of base trunk for new branch *" echo " --pre-roll: display commands to prepare for the roll" echo " --roll: display Git commands to execute for creating" echo " branches for the roll" echo " --info: display hashes for $BASE and $LAST on each" echo " branch (stripped$OLD, trunkdata$OLD, and" echo " trunkdata$NEW)" echo " --help: this message" echo echo "* - required" echo echo "* Script will prompt interactively if options not given." echo "** Argument must be specified." echo exit 1 } proc verbose_message { if test $do_verbose = 1 { if test $(1) = "" { echo } else { echo -e "...$(1)..." } } } # Does the file src/.git/config contains the added lines pointing to the chrome # remote dart$OLD and dart$NEW branches for src/ (e.g, dart1847 and dart1908): # # [svn-remote "dart$OLD"] # url = svn://svn.chromium.org/chrome/branches/dart/$OLD/src # fetch = :refs/remotes/dart1847 # [svn-remote "dart$NEW"] # url = svn://svn.chromium.org/chrome/branches/dart/$NEW/src # fetch = :refs/remotes/dart1908 # # and does the file src/third_party/WebKit/.git/config contains the added lines # for blink: # # [svn-remote "dart$OLD"] # url = svn://svn.chromium.org/blink/branches/dart/$OLD/src # fetch = :refs/remotes/dart1847 # [svn-remote "dart$NEW"] # url = svn://svn.chromium.org/blink/branches/dart/$NEW/src # fetch = :refs/remotes/dart1908 # proc validate_remotes { verbose_message "Validating Remotes" if test $do_which = "chrome" { # Ensure remote for old Dartium release exist (e.g., remotes/dart1847) global remote_dart_last := $[git branch -a | grep "remotes/dart$(do_old_branch)] # Ensure remote for new Dartium release exist (e.g., remotes/dart1908) global remote_dart_new := $[git branch -a | grep "remotes/dart$(do_new_branch)] if test $remote_dart_last = "" { $[display_error "missing old remotes/dart$(do_old_branch)] exit -1 } if test $remote_dart_new = "" { $[display_error "missing new remotes/dart$(do_new_branch)] exit -1 } } elif test $do_which = "blink" { # Ensure remote for old Dartium release exist (e.g., remotes/dart1847) global remote_dart_last := $[git branch -a | grep "remotes/blink-svn/$(do_old_branch)] # Ensure remote for new Dartium release exist (e.g., remotes/dart1908) global remote_dart_new := $[git branch -a | grep "remotes/blink-svn/multivm-$(do_new_branch)] if test $remote_dart_last = "" { $[display_error "missing old remotes/blink-svn/$(do_old_branch)] exit -1 } if test $remote_dart_new = "" { $[display_error "missing new remotes/blink-svn/multivm-$(do_new_branch)] exit -1 } } else { $[display_error "--chrome or --blink must be specified] exit -1 } } proc stripped_exist { var branch_name = $[git branch --no-color --list $[stripped_name] | sed 's/^[ \t\*]*//] echo $branch_name } # Does the branch trunkdart$OLD or trunkdart$NEW exist where $OLD is previous # branch (e.g. 1847) and $NEW is new branch to roll (e.g., 1908) # $(trunk_exist ${do_old_branch}) or $(trunk_exist ${do_new_branch}) # Strip out the spaces and * (implies current branch) then return the branch name. proc trunk_exist { var branch_name = $[git branch --list --no-color trunkdart$(1) | sed 's/^[ \t\*]*//' | tail -n 1] echo $branch_name } proc validate_repository { verbose_message "Validating Repository" global strip_branch := $(stripped_name) # Validate that branches exist. global stripped_found := $(stripped_exist) global old_branch_found := $[trunk_exist $(do_old_branch)] global new_branch_found := $[trunk_exist $(do_new_branch)] if test $stripped_found != "" { $[display_error "branch $(strip_branch) already exist] exit -1 } if test $old_branch_found != "" { $[display_error "branch trunkdart$(do_old_branch) already exist] exit -1 } if test $new_branch_found != "" { $[display_error "branch trunkdart$(do_new_branch) already exist] exit -1 } } proc display_error { echo -e "\n\e[1;31mERROR: $(1)\e[0m\n" > !2 exit 1 } # Given a revision number $1 return the trunk's hash code for that revision. proc hash_trunk_revision { # Chrome trunk hash code for [NewChromeCommit] global hash_trunk := $[git log master --grep=src@$(1) --pretty=format:'%H' -n 1] } # Return the last revision for a branch. Used by new trunk roll for the # DEPS file for the last revision to use during build. proc last_revision { echo $[git svn log $(1) --oneline -1 | cut -d '|' -f1 | sed "s/r//] } # Return the branch for strippedOOOO use bash line: # $(stripped_name) proc stripped_name { echo "stripped$(do_old_branch)" } # Give a branch name return the trunk release for that branch. proc trunkdart_name { echo "trunkdart$(1)" } # Compute the hash codes for the previous branch hash_base is the first commit # and hash_last is final commit. proc hash_codes_base_last { # Get the first commit for previous Dartium roll on chrome branch. global hash_base := $[git rev-list $(1) --pretty=format:'%H' | tail -n 1] # Get the last commit for previous Dartium roll on chrome branch. global hash_last := $[git log $(1) --pretty=format:'%H' -1] } # Compute the hash codes for the previous branch hash_base is the first commit # and hash_last is final commit. proc hash_codes_base2_last2 { # Get the last commit for previous Dartium roll on chrome branch. global hash_last2 := $[git log $(1) --pretty=format:'%H' -1] var search = '' if test $do_which = "chrome" { search := ""chrome/trunk/src@$(do_old_revision)"" } else { search := ""blink/branches/dart/multivm-$(do_new_revision)@$(do_old_revision)"" } # Get the first commit for previous Dartium roll on chrome branch. global hash_base2 := $[git log $(1) --grep=@$(do_old_revision) --pretty=format:'%H' | tail -1] } # Pad right/left up to 80 spaces. # Parameter $1 string to pad. # Parameter $2 is max length to post-pad with spaces. # Parameter $3 if specified padd to the right otherwise pad to the right. # Returns string right padded with spaces. proc space_pad { var spaces = $[printf '%0.1s' " "{1..80}] var spaces_pad = $(spaces:0:$2) var padding = $[printf "%s" $(spaces_pad:${#1})] if [[ "$3" = "" ]] { # Pad to the right [default]. echo "$(1)$(padding)" } else { # Pad to the left. echo "$(padding)$(1)" } } # Format the line '| URL: |'. # Paramter $1 - url to format # Returns the formatted and space padded line for display_hashes. proc display_url { # Line length is 65, skipped # 9 characters at beginning '| URL: ' # and last character '|'. Up to 55 characters of padding. var format_url = $[space_pad $1 55] var valid_url = $[valid_branch_url $1] if [[ "$valid_url" = "" ]] { # Error format padding is same as above remote_url 55; var format_err = $[space_pad "WARNING ON TRUNK - FIX IMMEDIATELY" 55] # Output in red, the problem, both lines the URL and the warning message. echo -e "| URL: \e[1;31m$(format_url)\e[0m|\n| \e[1;31m$(format_err)\e[0m|" } else { # URL looks good. echo "| URL: $(format_url)|" } } proc display_hashes { if test $do_info_hashes = 1 { var format_which = $[space_pad $do_which 6 1] global stripped_branch := $[stripped_name] # stripped$OLD found global stripped_found := $[stripped_exist] if test $stripped_found != "" { hash_codes_base_last $(stripped_branch) hash_trunk_revision $(do_old_revision) # Display the first/last commit hash for stripped$OLD branch and the # trunk hash for $OLD@do_last_revsion. echo "=================================================================" var format_branch = $[space_pad $stripped_branch 32 1] echo "| \$OLD: $(format_which) dart$(do_old_branch)@$(do_old_revision)$(format_branch) |" var remote_url = $[url_branch $stripped_branch] # TODO(terry): Testing failure below remove before checkin # local remote_url=$(url_branch "master") echo $[display_url $remote_url] echo "|---------------------------------------------------------------|" var format_hash = $[space_pad $hash_base 51] echo "| \$BASE | $(format_hash) |" echo "|---------------------------------------------------------------|" format_hash := $[space_pad $hash_last 51] echo "| \$LAST | $(format_hash) |" echo "=================================================================" echo } else { echo "$(stripped_branch) not found" echo } # trunkdart$OLD found global branch_trunkdart_old := $[trunkdart_name $(do_old_branch)] global old_branch_found := $[trunk_exist $(do_old_branch)] if test $old_branch_found != "" { hash_codes_base2_last2 $(branch_trunkdart_old) hash_trunk_revision $(do_old_revision) # Display the first/last commit hash for trunkdart$OLD branch and the # trunk hash for $OLD@do_last_revsion. echo "=================================================================" var format_branch = $[space_pad $branch_trunkdart_old 32 1] echo "| \$OLD $(format_which) dart$(do_old_branch)@$(do_old_revision)$(format_branch) |" var remote_url = $[url_branch $branch_trunkdart_old] echo $[display_url $remote_url] echo "|---------------------------------------------------------------|" var format_base2 = $[space_pad $hash_base2 51] echo "| \$BASE2 | $(format_base2) |" echo "|---------------------------------------------------------------|" var format_last2 = $[space_pad $hash_last2 51] echo "| \$LAST2 | $(format_last2) |" echo "=================================================================" echo } else { echo "$(branch_trunkdart_old) not found" echo } # trunkdart$NEW found global branch_trunkdart_new := $[trunkdart_name $(do_new_branch)] global new_branch_found := $[trunk_exist $(do_new_branch)] if test $new_branch_found != "" { hash_trunk_revision $(do_new_revision) # Display the trunk hash for $NEW@do_new_revsion. echo "=================================================================" var format_branch = $[space_pad $branch_trunkdart_new 32 1] echo "| \$NEW $(format_which) dart$(do_new_branch)@$(do_new_revision)$(format_branch) |" var remote_url = $[url_branch $branch_trunkdart_new] echo $[display_url $remote_url] echo "|---------------------------------------------------------------|" var revision = $[last_revision $branch_trunkdart_new] var format_revision = $[space_pad $revision 43] echo "| last revision | $(format_revision) |" echo "=================================================================" echo } else { echo "$(branch_trunkdart_new) not found" echo } } } proc switch_branch { $[git checkout $(1) --quiet] var curr_branch = $[git name-rev --name-only HEAD] if [[ "$curr_branch" != "$1" ]] { $[display_error "Unable to switch to branch $1 - pending commits/add?] exit -1 } echo $curr_branch } # Check that the branch is not pointing to either blink or chrome trunk. # These branches should be pointing to either: # svn://svn.chromium.org/chrome/branches/dart/NNNN # svn://svn.chromium.org/blink/branches/dart/NNNN # # $1 parameter - branch-name to make current branch and check repository # name. proc check_branch { var old_branch = $[git name-rev --name-only HEAD] var curr_branch = $[switch_branch $1] var trunk_url = ''; if test $do_which = "chrome" { # Chrome trunk_url := ''Committing to svn://svn.chromium.org/chrome/trunk/src ...'' } elif test $do_which = "blink" { # Blink trunk_url := ''Committing to svn://svn.chromium.org/blink/trunk ...'' } else { $[display_error "Neither blink or chrome specified] exit -1 } var remote_commit = $[git svn dcommit --dry-run | head -1 | grep $(trunk_url)] curr_branch := $[switch_branch $old_branch] if [[ "$curr_branch" != "$old_branch" ]] { $[display_error "Unable to switch back to original branch $(old_branch)] exit -1 } if [[ "$remote_commit" != "" ]] { $[display_error "Branch $(1) is NOT pointing to the Dart branch repository but pointing to trunk.] exit -1 } echo "Local branch '$(1)' is based on the remote branch/dart repository." } # Given an URL of a remote repository passed as parameter $1 (e.g., from # url_branch function) return the URL passed in if valid or return empty # string "". proc valid_branch_url { # Compute what the remote repository should be: # svn://svn.chromium.org/${do_which}/branches/dart/${do_old_branch}/src # e.g., svn://svn.chromium.org/chrome/branches/dart/1847/src # or blink: # svn://svn.chromium.org/blink/branches/dart/${do_old_branch} # e.g., svn://svn.chromium.org/blink/branches/dart/1847 var src_dir = ''"" if [[ "$do_which" = "chrome" ]] { src_dir := '"/src'" } var old_remote = ""svn://svn.chromium.org/$(do_which)/branches/dart/$(do_old_branch)$(src_dir)"" var new_remote = ""svn://svn.chromium.org/$(do_which)/branches/dart/$(do_new_branch)$(src_dir)"" echo $[echo $1 | grep -e $(old_remote) -e $(new_remote)] } # Returns the remote repository URL associated with a branch. # Parameter $1 is the branch name. proc url_branch { var old_branch = $[git name-rev --name-only HEAD] var curr_branch = $[switch_branch $1] var remote_commit = $[git svn dcommit --dry-run | head -1 | sed 's/Committing to //' | sed 's/ ...//] curr_branch := $[switch_branch $old_branch] echo $(remote_commit) } # Ensure that any created branches (stripped$OLD, trunkdart$OLD and # trunkdart$NEW) are not pointing to either the blink or chrome trunks. proc validate_branches { # stripped branch var stripped_found = $[stripped_exist] if test $stripped_found != "" { var branch_name = $[stripped_name] var check_result = $[check_branch $(branch_name)] printf "%s\n" $check_result } # trunkdart$OLD var branch_trunkdart_old = $[trunkdart_name $(do_old_branch)] var old_branch_found = $[trunk_exist $(do_old_branch)] if test $old_branch_found != "" { var check_result = $[check_branch $branch_trunkdart_old] printf "%s\n" $check_result } # trunkdart$NEW var branch_trunkdart_new = $[trunkdart_name $(do_new_branch)] var new_branch_found = $[trunk_exist $(do_new_branch)] if test $new_branch_found != "" { var check_result = $[check_branch $branch_trunkdart_new] printf "%s\n" $check_result } } proc display_roll_commands { if test $roll_branches = 1 { if test $do_which = "chrome" { roll_chrome_commands } elif test $do_which = "blink" { roll_blink_commands } } } # Show commands to create SVN branch folder and remote repository for new roll. proc display_remote_repository_creation { # TODO(terry): Use the diretory passed in instead of hard-coded dartium-NNNN # TODO(terry): Should execute each command with a Y or N and command runs. # TODO(terry): Echo output from commands especially clone and rebase using "OUTPUT=$(git cl rebase); echo $OUTPUT" # TODO(terry): Add ability to copy to clipboard programmatically us 'echo "hi" | xclip -selection clipboard' # copies hi to clipboard. echo "Do the following pre-roll setup" if test $do_which = "chrome" { echo " mkdir dartium-$(do_new_branch)" echo " cd dartium-$(do_new_branch)" echo " svn mkdir -m \"Preparing Chrome 35/$(do_new_branch) branch\" "\ "svn://svn.chromium.org/chrome/branches/dart/$(do_new_branch)" echo " svn cp -m \"Branching for $(do_new_branch) @$(do_new_revision)\" "\ "svn://svn.chromium.org/chrome/trunk/src@$(do_new_revision) "\ "svn://svn.chromium.org/chrome/branches/dart/$(do_new_branch)/src" echo " git svn clone -r241107 svn://svn.chromium.org/chrome/trunk/src src" echo echo " cd src" echo " git cl rebase" echo echo "-----After rebase finishes-----" echo echo " 1. Add the below lines to src/.git/config" echo echo "[svn-remote \"dart$(do_old_branch)\"]" echo " url = svn://svn.chromium.org/chrome/branches/dart/$(do_old_branch)/src" echo " fetch = :refs/remotes/dart$(do_old_branch)" echo "[svn-remote \"dart$(do_new_branch)\"]" echo " url = svn://svn.chromium.org/chrome/branches/dart/$(do_new_branch)/src" echo " fetch = :refs/remotes/dart$(do_new_branch)" echo echo " 2. Get the code" echo echo " cd src" echo " git svn fetch dart$(do_old_branch) && git svn fetch dart$(do_new_branch)" } elif test $do_which = "blink" { echo " Directory dartium-$(do_new_branch) exists." echo " cd dartium-$(do_new_branch)" echo " svn cp -m \"Branching $(do_new_branch) @$(do_new_revision)\" "\ "svn://svn.chromium.org/blink/trunk@$(do_new_revision) "\ "svn://svn.chromium.org/blink/branches/dart/$(do_new_branch)" echo " git svn clone --trunk=trunk --branches=branches/dart"\ " --prefix=blink-svn/ -r165883:HEAD " \ "svn://svn.chromium.org/blink src/third_party/WebKit" echo echo " cd src/third_party/WebKit" echo " git cl rebase" echo echo "-----After rebase finishes-----" echo echo " 1. Add the below lines to src/third_party/WebKit/.git/config" echo echo "[svn-remote \"dart$(do_old_branch)\"]" echo " url = svn://svn.chromium.org/blink/branches/dart/$(do_old_branch)" echo " fetch = :refs/remotes/dart$(do_old_branch)" echo "[svn-remote \"dart$(do_new_branch)\"]" echo " url = svn://svn.chromium.org/blink/branches/dart/$(do_new_branch)" echo " fetch = :refs/remotes/dart$(do_new_branch)" echo echo " 2. Get the code" echo echo " cd src/third_party/WebKit" #TODO(terry): Should the fetch be remotes/blink-svn/multivm-${do_new_branch} echo " git svn fetch dart$(do_old_branch) && git svn fetch dart$(do_new_branch)" } } # Displays each of the 3 steps, of GIT commands, to create the # branches for a Dartium roll. # # Givin the following Dartium roll information: # Previous Dartium roll 1847 @251094 ($OLD) # New Dartium roll to make 1908 @ 259084 ($NEW) # # Three branches will be created a stripped[$OLD], trunkdart[$OLD] # and trunkdart[$NEW]. # # |==============================================| # | $OLD | 1847 | # |----------------------------------------------| # | $OLD_REV | 251094 | # |----------------------------------------------| # | $NEW | 1908 | # |----------------------------------------------| # | $NEW_REV | 259084 | # |==============================================| # # stripped$OLD - Branch with upstream patches stripped out. # trunkdart$OLD - Branch with all patches for $OLD. # trunkdart$NEW - Branch of a new Chromium/Blink release with # cherry-picked $OLD commits from trunkdart$OLD. # # stripped$OLD, trunkdart$OLD points the SVN remote repository # # svn://svn.chromium.org/chrome/branches/dart/1847/src # # trunkdart$NEW points to the SVN remote repository # svn://svn.chromium.org/chrome/branches/dart/1908/src # # STEP 1. # ------- # Create the stripped$OLD: # > git checkout -b stripped$OLD dart$OLD # > git rebase -i $BASE # # e.g., git checkout -b stripped1847 dart1847 # git rebase -i 3345f6a26911beda2ed352e887549bc514acb4bd # # Rebasing with -i will launch an editor, show all commits after $BASE and let # you interactively remove any upstream commits from trunk. Upstream commits # have a format of "Incrementing VERSION to 32.0.1847.78". Then save and quit # the editor. # # $BASE and $LAST are computed by this script and is returned in the # 'git rebase -i ' command. # # NOTE: How $BASE and $LAST are computed: # --------------------------------------- # $BASE, first commit in $OLD, is computed by: # > git rev-list stripped1847 --pretty=format:'%H' | tail -n 1 # Return a GIT hash code e.g., 3345f6a26911beda2ed352e887549bc514acb4bd # # $LAST, last commit in $NEW, is computed by: # > git log stripped1847 --pretty=format:'%H' -1 # Return a GIT hash code e.g., 44d12cd4b7e041f8d06f8735f1af08abb66825c4 # # STEP 2. # ------- # Create the trunkdart$OLD e.g., # > git checkout -b trunkdart$OLD $BASE # > git cherry-pick $BASE..$LAST # # e.g., git checkout -b trunkdart1847 # # Create branch trunkdart$OLD and reapplies all Dart-related work on $OLD (from # the stripped branch created in Step1.). This cherry-pick should not have any # conflicts as you are rebasing onto exactly the same source code layout. # # STEP 3. # ------- # Create the branch for $NEW (trunkdart$NEW): # > git checkout -b trunkdart$NEW dart$NEW # > git cherry-pick $BASE2..$LAST2 # # Important points trunkdart$NEW is attached to the remote SVN repository created # in pre-steps. # # e.g., git checkout -b trunkdart1908 dart1908 # git cherry-pick xxxx..xxxx # # $BASE2 should be the same as $BASE to validate with: # # > git log trunkdart$OLD --grep=@$OLD_REV --pretty=format:'%H' | tail -1 # # e.g., git log trunkdart1847 --grep=251094 --pretty=format:'%H' | tail -1 # 3345f6a26911beda2ed352e887549bc514acb4bd # # $LAST2 is the last commit in $OLD in trunkdart$OLD computed by: # # > git log trunkdart$OLD --pretty=format:'%H' -1 # # e.g., > git log trunkdart1847 --pretty=format:'%H' -1 # 2549d8ecd211ee6fed6699d70f319e077b425be4 # # The we'll cherry-pick commits from $OLD. # e.g., # > git cherry-pick 3345f6a26911beda2ed352e887549bc514acb4bd..2549d8ecd211ee6fed6699d70f319e077b425be4 # # Cherry picking is an iterative process. Each commit in the $OLD branch is # applied to the $NEW branch any conflicts will need to fixed. # # Fix each file conflict(s) in a particular commit: # # > vim # > git add # # When all file conflicts for a particular commit are done then: # # > git commit -a -m "Merged $OLD" # # Continue the original cherry-picking # > git cherry-pick --continue # # # ******************************************************************** # * IMPORTANT: * # ******************************************************************** # # When all commits are made to our new trunk (trunkdart$NEW). Then try an # initial dcommit with the --dry-run option. # # > git svn dcommit --dry-run # # e.g., git svn dcommit --dry-run # Committing to svn://svn.chromium.org/chrome/branches/dart/1908/src ... # diff-tree 48e85b5f247696c432d9dbb55c37f88f4df8a06a~1 48e85b5f247696c432d9dbb55c37f88f4df8a06a # ... # # It is important to check the first line "Committing to " the repository # should be the new remote SVN e.g., svn://svn.chromium.org/chrome/branches/dart/1908/src ... # # IT SHOULD NOT BE "svn://svn.chromium.org/chrome/trunk/src ..." this will # dcommit the changes to the chrome trunk and break the chromium build. # proc roll_chrome_commands { global stripped_found := $[stripped_exist] global old_branch_found := $[trunk_exist $(do_old_branch)] global new_branch_found := $[trunk_exist $(do_new_branch)] echo echo "================================================" echo "| git commands to run: |" echo "================================================" global remoteOld := "dart$(do_old_branch)" global strip_branch := $[stripped_name] if test $stripped_found = "" { echo "------------------ Step 1. ---------------------" echo # Git command to create stripped old branch. echo "git checkout -b $(strip_branch) $(remoteOld)" # Get hashes for base for do_old_branch. hash_codes_base_last $(remoteOld) echo "git rebase -i $(hash_base)" echo } elif test $old_branch_found = "" { echo "------------------ Step 2. ---------------------" echo # Get hashes for base, last and base hash from trunk for the last branch. hash_codes_base_last $(strip_branch) # Git command to create old branch with only changes from base to last # commits for that branch. Checkout based on stripped$OLD first commit # $BASE. global branch_trunkdart_old := $[trunkdart_name $(do_old_branch)] echo "git checkout -b $(branch_trunkdart_old) $(hash_base)" echo "git cherry-pick $(hash_base)..$(hash_last)" echo } elif test $new_branch_found = "" { echo "------------------ Step 3. ---------------------" echo # Git command to create new branch to roll. global branch_trunkdart_new := $[trunkdart_name $(do_new_branch)] # get base and last commit hashes of the trunkdart$OLD hash_codes_base2_last2 $(branch_trunkdart_old) echo "git checkout -b $(branch_trunkdart_new) $(remoteOld)" echo "git cherry-pick $(hash_base2)..$(hash_last2)" echo } else { echo "===== Nothing to do - Roll setup complete. =====" } echo "================================================" } proc roll_blink_commands { global stripped_found := $[stripped_exist] global old_branch_found := $[trunk_exist $(do_old_branch)] global new_branch_found := $[trunk_exist $(do_new_branch)] echo echo "================================================" echo "| git commands to run: |" echo "================================================" global remoteOld := "dart$(do_old_branch)" global strip_branch := $[stripped_name] if test $stripped_found = "" { echo "------------------ Step 1. ---------------------" echo # Git command to create stripped old branch. echo "git checkout -b $(strip_branch) $(remoteOld)" # Get hashes for base dir do_old_branch. hash_codes_base_last $(remoteOld) eho "git rebase -i $(hash_base)" echo } elif test $old_branch_found = "" { echo "------------------ Step 2. ---------------------" echo # Get hashes for base, last and base hash from trunk for the last branch. hash_codes_base_last $(strip_branch) # Git command to create old branch with only changes from base to last # commits for that branch. Checkout based on stripped$OLD first commit # $BASE. global branch_trunkdart_old := $[trunkdart_name $(do_old_branch)] echo "git checkout -b $(branch_trunkdart_old) $(hash_base)" echo "git cherry-pick $(hash_base)..$(hash_last)" echo } elif test $new_branch_found = "" { echo "------------------ Step 3. ---------------------" echo # Git command to create new branch to roll. global branch_trunkdart_new := $[trunkdart_name $(do_new_branch)] # get base and last commit hashes of the trunkdart$OLD hash_codes_base2_last2 $(branch_trunkdart_old) echo "git checkout -b $(branch_trunkdart_new) $(remoteOld)" echo "git cherry-pick $(hash_base2)..$(hash_last2)" echo } else { echo "===== Nothing to do - Roll setup complete. =====" } echo "================================================" } # checkout strippedOOOO and trunkdartNNNN global create_branches := '0' global do_info_hashes := '0' global base_dir := ''"" # Display the pre-roll commands; if specified nothing else is displayed. global do_pre_roll := '0' # which branch chrome or blink global do_which := ''"" # Display detail information about all major steps global do_verbose := '0' # $OLD branch global do_old_branch := ''"" global do_old_revision := ''"" # $NEW branch global do_new_branch := ''"" global do_new_revision := ''"" global curr_switch := ''"" for var in [@Argv] { matchstr $var { --help { usage exit } --verbose { global do_verbose := '1' global curr_switch := ''"" } --no-verbose { global do_verbose := '0' global curr_switch := ''"" } --chrome { if test $do_which != "" { $[display_error "--chrome can not be specified with --blink] exit $E_INVALID_ARG } global do_which := '"chrome'" global curr_switch := ''"" } --blink { if test $do_which != "" { $[display_error "--blink can not be specified with --chrome] exit $E_INVALID_ARG } global do_which := '"blink'" global curr_switch := ''"" } --pre-roll { global do_pre_roll := '1' global curr_switch := ''"" } --roll { global roll_branches := '1' global curr_switch := ''"" } --info { global do_info_hashes := '1' global curr_switch := ''"" } --directory { global curr_switch := '"base-directory'" # takes an argument. } --old-branch { global curr_switch := '"old-branch'" # takes an argument. } --new-branch { global curr_switch := '"new-branch'" # takes an argument. } --old-revision { global curr_switch := '"old-revision'" # takes an argument. } --new-revision { global curr_switch := '"new-revision'" # takes an argument. } * { global prefix := $(var:0:2) if test $prefix = "--" { $[display_error "unexpected switch $(var)] exit $E_INVALID_ARG } matchstr $curr_switch { base-directory { global base_dir := $(var) } old-branch { global do_old_branch := $(var) } old-revision { global do_old_revision := $(var) } new-branch { global do_new_branch := $(var) } new-revision { global do_new_revision := $(var) } * { if test $curr_switch != "" { $[display_error "unexpected paramter for $(curr_switch)] exit $E_INVALID_ARG } else { $[display_error "unexpected switch $(var)] exit $E_INVALID_ARG } } } global curr_switch := ''"" } } } # Insure that everything is known otherwise prompt information. if test $base_dir = "" { echo "--directory switch must be specified." exit $E_INVALID_ARG } if test $do_which == "" { echo "--chrome or --blink switch must be specified." exit $E_INVALID_ARG } if test $do_old_branch = "" { echo "Enter LAST $(do_which) true branch (e.g., Chrome version 34.0.1847.92 true branch is 1847)" read do_old_branch } if test $do_old_revision = "" { echo "Enter LAST $(do_which) base trunk revision #" read do_old_revision } if test $do_new_branch = "" { echo "Enter NEW $(do_which) true branch (e.g., Chrome version 35.0.1908.4 true branch is 1908)" read do_new_branch } if test $do_new_revision = "" { echo "Enter NEW $(do_which) base trunk revision #" read do_new_revision } echo echo "Rolling new branch $(do_new_branch)@$(do_new_revision)" verbose_message verbose_message "Previous branch $(do_old_branch)@$(do_old_revision)" verbose_message "New branch $(do_new_branch)@$(do_new_revision)" verbose_message if [[ "$do_pre_roll" = "1" ]] { display_remote_repository_creation exit 1 } pushd . > /dev/null if test $base_dir != "" { cd $(base_dir) } cd src if test $do_which = "blink" { cd third_party/WebKit } # Disable ^C and ^Z while running script. trap '' INT trap '' TSTP validate_remotes display_roll_commands display_hashes # Insure that all local branches for the roll are NOT based on the chrome or # blink trunks. validate_branches # Re-enable ^C and ^Z. trap - INT trap - TSTP popd > /dev/null (CommandList children: [ (C {(set)} {(-e)}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:E_INVALID_ARG) op:Equal rhs:{(128)} spids:[50])] spids: [50] ) (FuncDef name: usage body: (BraceGroup children: [ (C {(echo)} {(DQ ("Usage: ") ($ VSub_Number "$0") (" [--options]"))}) (C {(echo)} {(DQ ("Options:"))}) (C {(echo)} {(DQ (" --[no-]verbose: display information about each step"))}) (C {(echo)} {(DQ (" --directory base: base directory of local git repository"))}) (C {(echo)} {(DQ (" (e.g., ~/dartium-roll implies directory"))}) (C {(echo)} {(DQ (" ~/dartium-roll/src and"))}) (C {(echo)} {(DQ (" ~/dartium-roll/src/third_party/WebKit)**"))}) (C {(echo)} {(DQ (" --chrome: for the Chrome branch (not with --blink)**"))} ) (C {(echo)} {(DQ (" --blink: for the Blink branch (not with --chrome)**"))} ) (C {(echo)} {(DQ (" --old-branch name: name of previous true branch (e.g., use 1847"))} ) (C {(echo)} {(DQ (" for version 34.0.1847.92) *"))}) (C {(echo)} { (DQ (" --old-revision revision: revision of base trunk for ") ($ VSub_Name "$OLD") (" version *") ) } ) (C {(echo)} {(DQ (" --new-branch name: name of new true branch to create *"))}) (C {(echo)} {(DQ (" --new-revision revision: revision of base trunk for new branch *"))}) (C {(echo)} {(DQ (" --pre-roll: display commands to prepare for the roll"))}) (C {(echo)} {(DQ (" --roll: display Git commands to execute for creating"))} ) (C {(echo)} {(DQ (" branches for the roll"))}) (C {(echo)} { (DQ (" --info: display hashes for ") ($ VSub_Name "$BASE") (" and ") ($ VSub_Name "$LAST") (" on each") ) } ) (C {(echo)} { (DQ (" branch (stripped") ($ VSub_Name "$OLD") (", trunkdata") ($ VSub_Name "$OLD") (", and") ) } ) (C {(echo)} {(DQ (" trunkdata") ($ VSub_Name "$NEW") (")"))}) (C {(echo)} {(DQ (" --help: this message"))}) (C {(echo)}) (C {(echo)} {(DQ ("* - required"))}) (C {(echo)}) (C {(echo)} {(DQ ("* Script will prompt interactively if options not given."))}) (C {(echo)} {(DQ ("** Argument must be specified."))}) (C {(echo)}) (C {(exit)} {(1)}) ] spids: [58] ) spids: [54 57] ) (FuncDef name: verbose_message body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$do_verbose"))} {(Lit_Other "=")} {(1)} {(Lit_Other "]")} ) terminator: ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ (${ VSub_Number 1))} {(Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [(C {(echo)})] spids: [-1 303] ) ] else_action: [(C {(echo)} {(-e)} {(DQ (...) (${ VSub_Number 1) (...))})] spids: [309 325] ) ] spids: [-1 282] ) ] spids: [-1 328] ) ] spids: [264] ) spids: [260 263] ) (FuncDef name: validate_remotes body: (BraceGroup children: [ (C {(verbose_message)} {(DQ ("Validating Remotes"))}) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$do_which"))} {(Lit_Other "=")} {(DQ (chrome))} {(Lit_Other "]")} ) terminator: ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:remote_dart_last) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(git)} {(branch)} {(-a)}) (C {(grep)} {(DQ (remotes/dart) (${ VSub_Name do_old_branch))}) ] negated: False ) ] ) left_token: spids: [434 451] ) } spids: [433] ) ] spids: [433] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:remote_dart_new) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(git)} {(branch)} {(-a)}) (C {(grep)} {(DQ (remotes/dart) (${ VSub_Name do_new_branch))}) ] negated: False ) ] ) left_token: spids: [459 476] ) } spids: [458] ) ] spids: [458] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$remote_dart_last"))} {(Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C { (CommandSubPart command_list: (CommandList children: [ (C {(display_error)} { (DQ ("missing old remotes/dart") (${ VSub_Name do_old_branch) ) } ) ] ) left_token: spids: [498 507] ) } ) (C {(exit)} {(-1)}) ] spids: [-1 495] ) ] spids: [-1 515] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$remote_dart_new"))} {(Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C { (CommandSubPart command_list: (CommandList children: [ (C {(display_error)} { (DQ ("missing new remotes/dart") (${ VSub_Name do_new_branch) ) } ) ] ) left_token: spids: [537 546] ) } ) (C {(exit)} {(-1)}) ] spids: [-1 534] ) ] spids: [-1 554] ) ] spids: [-1 426] ) (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$do_which"))} {(Lit_Other "=")} {(DQ (blink))} {(Lit_Other "]")} ) terminator: ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:remote_dart_last) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(git)} {(branch)} {(-a)}) (C {(grep)} {(DQ (remotes/blink-svn/) (${ VSub_Name do_old_branch))} ) ] negated: False ) ] ) left_token: spids: [582 599] ) } spids: [581] ) ] spids: [581] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:remote_dart_new) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(git)} {(branch)} {(-a)}) (C {(grep)} { (DQ (remotes/blink-svn/multivm-) (${ VSub_Name do_new_branch) ) } ) ] negated: False ) ] ) left_token: spids: [607 624] ) } spids: [606] ) ] spids: [606] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$remote_dart_last"))} {(Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C { (CommandSubPart command_list: (CommandList children: [ (C {(display_error)} { (DQ ("missing old remotes/blink-svn/") (${ VSub_Name do_old_branch) ) } ) ] ) left_token: spids: [647 656] ) } ) (C {(exit)} {(-1)}) ] spids: [-1 644] ) ] spids: [-1 664] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$remote_dart_new"))} {(Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C { (CommandSubPart command_list: (CommandList children: [ (C {(display_error)} { (DQ ("missing new remotes/blink-svn/multivm-") (${ VSub_Name do_new_branch) ) } ) ] ) left_token: spids: [686 695] ) } ) (C {(exit)} {(-1)}) ] spids: [-1 683] ) ] spids: [-1 703] ) ] spids: [557 574] ) ] else_action: [ (C { (CommandSubPart command_list: (CommandList children: [ (C {(display_error)} {(DQ ("--chrome or --blink must be specified"))}) ] ) left_token: spids: [709 715] ) } ) (C {(exit)} {(-1)}) ] spids: [706 723] ) ] spids: [398] ) spids: [394 397] ) (FuncDef name: stripped_exist body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:branch_name) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(git)} {(branch)} {(--no-color)} {(--list)} { (CommandSubPart command_list: (CommandList children:[(C {(stripped_name)})]) left_token: spids: [747 749] ) } ) (C {(sed)} {(SQ <"s/^[ \\t\\*]*//">)}) ] negated: False ) ] ) left_token: spids: [738 758] ) } spids: [737] ) ] spids: [735] ) (C {(echo)} {($ VSub_Name "$branch_name")}) ] spids: [732] ) spids: [728 731] ) (FuncDef name: trunk_exist body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:branch_name) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(git)} {(branch)} {(--list)} {(--no-color)} {(trunkdart) (${ VSub_Number 1)} ) (C {(sed)} {(SQ <"s/^[ \\t\\*]*//">)}) (C {(tail)} {(-n)} {(1)}) ] negated: False ) ] ) left_token: spids: [790 819] ) } spids: [789] ) ] spids: [787] ) (C {(echo)} {($ VSub_Name "$branch_name")}) ] spids: [784] ) spids: [780 783] ) (FuncDef name: validate_repository body: (BraceGroup children: [ (C {(verbose_message)} {(DQ ("Validating Repository"))}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:strip_branch) op: Equal rhs: {(${ VSub_Name stripped_name)} spids: [844] ) ] spids: [844] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:stripped_found) op: Equal rhs: {(${ VSub_Name stripped_exist)} spids: [855] ) ] spids: [855] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:old_branch_found) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(trunk_exist)} {(${ VSub_Name do_old_branch)})] ) left_token: spids: [862 868] ) } spids: [861] ) ] spids: [861] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:new_branch_found) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(trunk_exist)} {(${ VSub_Name do_new_branch)})] ) left_token: spids: [872 878] ) } spids: [871] ) ] spids: [871] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$stripped_found"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C { (CommandSubPart command_list: (CommandList children: [ (C {(display_error)} {(DQ ("branch ") (${ VSub_Name strip_branch) (" already exist"))} ) ] ) left_token: spids: [902 912] ) } ) (C {(exit)} {(-1)}) ] spids: [-1 899] ) ] spids: [-1 920] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$old_branch_found"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C { (CommandSubPart command_list: (CommandList children: [ (C {(display_error)} { (DQ ("branch trunkdart") (${ VSub_Name do_old_branch) (" already exist") ) } ) ] ) left_token: spids: [944 954] ) } ) (C {(exit)} {(-1)}) ] spids: [-1 941] ) ] spids: [-1 962] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$new_branch_found"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C { (CommandSubPart command_list: (CommandList children: [ (C {(display_error)} { (DQ ("branch trunkdart") (${ VSub_Name do_new_branch) (" already exist") ) } ) ] ) left_token: spids: [986 996] ) } ) (C {(exit)} {(-1)}) ] spids: [-1 983] ) ] spids: [-1 1004] ) ] spids: [833] ) spids: [829 832] ) (FuncDef name: display_error body: (BraceGroup children: [ (SimpleCommand words: [ {(echo)} {(-e)} { (DQ (EscapedLiteralPart token:) (EscapedLiteralPart token:) ("[1;31mERROR: ") (${ VSub_Number 1) (EscapedLiteralPart token:) ("[0m") (EscapedLiteralPart token:) ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[1034])] ) (C {(exit)} {(1)}) ] spids: [1015] ) spids: [1009 1014] ) (FuncDef name: hash_trunk_revision body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:hash_trunk) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(git)} {(log)} {(master)} {(--grep) (Lit_Other "=") (src) (Lit_Other "@") (${ VSub_Number 1)} {(--pretty) (Lit_Other "=") (format) (Lit_Other ":") (SQ <"%H">)} {(-n)} {(1)} ) ] ) left_token: spids: [1061 1087] ) } spids: [1060] ) ] spids: [1060] ) ] spids: [1053] ) spids: [1049 1052] ) (FuncDef name: last_revision body: (BraceGroup children: [ (C {(echo)} { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(git)} {(svn)} {(log)} {(${ VSub_Number 1)} {(--oneline)} {(-1)}) (C {(cut)} {(-d)} {(SQ <"|">)} {(-f1)}) (C {(sed)} {(DQ (s/r//))}) ] negated: False ) ] ) left_token: spids: [1110 1144] ) } ) ] spids: [1105] ) spids: [1099 1104] ) (FuncDef name: stripped_name body: (BraceGroup children: [(C {(echo)} {(DQ (stripped) (${ VSub_Name do_old_branch))})] spids: [1160] ) spids: [1156 1159] ) (FuncDef name: trunkdart_name body: (BraceGroup children:[(C {(echo)} {(DQ (trunkdart) (${ VSub_Number 1))})] spids:[1183]) spids: [1179 1182] ) (FuncDef name: hash_codes_base_last body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:hash_base) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(git)} {(rev-list)} {(${ VSub_Number 1)} {(--pretty) (Lit_Other "=") (format) (Lit_Other ":") (SQ <"%H">)} ) (C {(tail)} {(-n)} {(1)}) ] negated: False ) ] ) left_token: spids: [1217 1241] ) } spids: [1216] ) ] spids: [1216] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:hash_last) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(git)} {(log)} {(${ VSub_Number 1)} {(--pretty) (Lit_Other "=") (format) (Lit_Other ":") (SQ <"%H">)} {(-1)} ) ] ) left_token: spids: [1250 1268] ) } spids: [1249] ) ] spids: [1249] ) ] spids: [1209] ) spids: [1205 1208] ) (FuncDef name: hash_codes_base2_last2 body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:hash_last2) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(git)} {(log)} {(${ VSub_Number 1)} {(--pretty) (Lit_Other "=") (format) (Lit_Other ":") (SQ <"%H">)} {(-1)} ) ] ) left_token: spids: [1292 1310] ) } spids: [1291] ) ] spids: [1291] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:search) op:Equal spids:[1316])] spids: [1314] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$do_which"))} {(Lit_Other "=")} {(DQ (chrome))} {(Lit_Other "]")} ) terminator: ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:search) op: Equal rhs: {(DQ ("chrome/trunk/src@") (${ VSub_Name do_old_revision))} spids: [1339] ) ] spids: [1339] ) ] spids: [-1 1336] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:search) op: Equal rhs: { (DQ (blink/branches/dart/multivm-) (${ VSub_Name do_new_revision) ("@") (${ VSub_Name do_old_revision) ) } spids: [1351] ) ] spids: [1351] ) ] spids: [1348 1364] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:hash_base2) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(git)} {(log)} {(${ VSub_Number 1)} {(--grep) (Lit_Other "=") (Lit_Other "@") (${ VSub_Name do_old_revision) } {(--pretty) (Lit_Other "=") (format) (Lit_Other ":") (SQ <"%H">)} ) (C {(tail)} {(-1)}) ] negated: False ) ] ) left_token: spids: [1373 1402] ) } spids: [1372] ) ] spids: [1372] ) ] spids: [1284] ) spids: [1280 1283] ) (FuncDef name: space_pad body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:spaces) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(printf)} {(SQ <"%0.1s">)} {(DQ (" ")) (Lit_LBrace "{") (1..80) (Lit_RBrace "}")} ) ] ) left_token: spids: [1435 1448] ) } spids: [1434] ) ] spids: [1432] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:spaces_pad) op: Equal rhs: { (BracedVarSub token: suffix_op: (Slice begin: (ArithWord w:{(Lit_Digits 0)}) length: (ArithWord w:{($ VSub_Number "$2")}) ) spids: [1454 1460] ) } spids: [1453] ) ] spids: [1451] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:padding) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(printf)} {(DQ ("%s"))} { (DQ (BracedVarSub token: suffix_op: (Slice begin: (ArithWord w: { (BracedVarSub token: prefix_op: VSub_Pound spids: [1477 1480] ) } ) ) spids: [1474 1481] ) ) } ) ] ) left_token: spids: [1466 1483] ) } spids: [1465] ) ] spids: [1463] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id:BoolBinary_GlobEqual left:{(DQ ($ VSub_Number "$3"))} right:{(DQ )}) ) terminator: ) ] action: [(C {(echo)} {(DQ (${ VSub_Number 1) (${ VSub_Name padding))})] spids: [-1 1503] ) ] else_action: [(C {(echo)} {(DQ (${ VSub_Name padding) (${ VSub_Number 1))})] spids: [1522 1541] ) ] spids: [1429] ) spids: [1423 1428] ) (FuncDef name: display_url body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:format_url) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(space_pad)} {($ VSub_Number "$1")} {(55)})] ) left_token: spids: [1576 1582] ) } spids: [1575] ) ] spids: [1573] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:valid_url) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(valid_branch_url)} {($ VSub_Number "$1")})] ) left_token: spids: [1588 1592] ) } spids: [1587] ) ] spids: [1585] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobEqual left: {(DQ ($ VSub_Name "$valid_url"))} right: {(DQ )} ) ) terminator: ) ] action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:format_err) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(space_pad)} {(DQ ("WARNING ON TRUNK - FIX IMMEDIATELY"))} {(55)} ) ] ) left_token: spids: [1621 1629] ) } spids: [1620] ) ] spids: [1618] ) (C {(echo)} {(-e)} { (DQ ("| URL: ") (EscapedLiteralPart token:) ("[1;31m") (${ VSub_Name format_url) (EscapedLiteralPart token:) ("[0m|") (EscapedLiteralPart token:) ("| ") (EscapedLiteralPart token:) ("[1;31m") (${ VSub_Name format_err) (EscapedLiteralPart token:) ("[0m|") ) } ) ] spids: [-1 1611] ) ] else_action: [(C {(echo)} {(DQ ("| URL: ") (${ VSub_Name format_url) ("|"))})] spids: [1661 1679] ) ] spids: [1562] ) spids: [1556 1561] ) (FuncDef name: display_hashes body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$do_info_hashes"))} {(Lit_Other "=")} {(1)} {(Lit_Other "]")} ) terminator: ) ] action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:format_which) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(space_pad)} {($ VSub_Name "$do_which")} {(6)} {(1)}) ] ) left_token: spids: [1713 1721] ) } spids: [1712] ) ] spids: [1710] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:stripped_branch) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(stripped_name)})]) left_token: spids: [1725 1727] ) } spids: [1724] ) ] spids: [1724] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:stripped_found) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(stripped_exist)})]) left_token: spids: [1735 1737] ) } spids: [1734] ) ] spids: [1734] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$stripped_found"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(hash_codes_base_last)} {(${ VSub_Name stripped_branch)}) (C {(hash_trunk_revision)} {(${ VSub_Name do_old_revision)}) (C {(echo)} { (DQ ( "=================================================================" ) ) } ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:format_branch) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(space_pad)} {($ VSub_Name "$stripped_branch")} {(32)} {(1)} ) ] ) left_token: spids: [1792 1800] ) } spids: [1791] ) ] spids: [1789] ) (C {(echo)} { (DQ ("| ") (EscapedLiteralPart token:) ("OLD: ") (${ VSub_Name format_which) (" dart") (${ VSub_Name do_old_branch) ("@") (${ VSub_Name do_old_revision) (${ VSub_Name format_branch) (" |") ) } ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:remote_url) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(url_branch)} {($ VSub_Name "$stripped_branch")}) ] ) left_token: spids: [1830 1834] ) } spids: [1829] ) ] spids: [1827] ) (C {(echo)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(display_url)} {($ VSub_Name "$remote_url")})] ) left_token: spids: [1848 1852] ) ) } ) (C {(echo)} { (DQ ( "|---------------------------------------------------------------|" ) ) } ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:format_hash) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(space_pad)} {($ VSub_Name "$hash_base")} {(51)}) ] ) left_token: spids: [1866 1872] ) } spids: [1865] ) ] spids: [1863] ) (C {(echo)} { (DQ ("| ") (EscapedLiteralPart token:) ("BASE | ") (${ VSub_Name format_hash) (" |") ) } ) (C {(echo)} { (DQ ( "|---------------------------------------------------------------|" ) ) } ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:format_hash) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(space_pad)} {($ VSub_Name "$hash_last")} {(51)}) ] ) left_token: spids: [1896 1902] ) } spids: [1895] ) ] spids: [1895] ) (C {(echo)} { (DQ ("| ") (EscapedLiteralPart token:) ("LAST | ") (${ VSub_Name format_hash) (" |") ) } ) (C {(echo)} { (DQ ( "=================================================================" ) ) } ) (C {(echo)}) ] spids: [-1 1757] ) ] else_action: [ (C {(echo)} {(DQ (${ VSub_Name stripped_branch) (" not found"))}) (C {(echo)}) ] spids: [1928 1944] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:branch_trunkdart_old) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(trunkdart_name)} {(${ VSub_Name do_old_branch)})] ) left_token: spids: [1953 1959] ) } spids: [1952] ) ] spids: [1952] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:old_branch_found) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(trunk_exist)} {(${ VSub_Name do_old_branch)})] ) left_token: spids: [1963 1969] ) } spids: [1962] ) ] spids: [1962] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$old_branch_found"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(hash_codes_base2_last2)} {(${ VSub_Name branch_trunkdart_old)}) (C {(hash_trunk_revision)} {(${ VSub_Name do_old_revision)}) (C {(echo)} { (DQ ( "=================================================================" ) ) } ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:format_branch) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(space_pad)} {($ VSub_Name "$branch_trunkdart_old")} {(32)} {(1)} ) ] ) left_token: spids: [2024 2032] ) } spids: [2023] ) ] spids: [2021] ) (C {(echo)} { (DQ ("| ") (EscapedLiteralPart token:) ("OLD ") (${ VSub_Name format_which) (" dart") (${ VSub_Name do_old_branch) ("@") (${ VSub_Name do_old_revision) (${ VSub_Name format_branch) (" |") ) } ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:remote_url) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(url_branch)} {($ VSub_Name "$branch_trunkdart_old")}) ] ) left_token: spids: [2062 2066] ) } spids: [2061] ) ] spids: [2059] ) (C {(echo)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(display_url)} {($ VSub_Name "$remote_url")})] ) left_token: spids: [2072 2076] ) ) } ) (C {(echo)} { (DQ ( "|---------------------------------------------------------------|" ) ) } ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:format_base2) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(space_pad)} {($ VSub_Name "$hash_base2")} {(51)}) ] ) left_token: spids: [2090 2096] ) } spids: [2089] ) ] spids: [2087] ) (C {(echo)} { (DQ ("| ") (EscapedLiteralPart token:) ("BASE2 | ") (${ VSub_Name format_base2) (" |") ) } ) (C {(echo)} { (DQ ( "|---------------------------------------------------------------|" ) ) } ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:format_last2) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(space_pad)} {($ VSub_Name "$hash_last2")} {(51)}) ] ) left_token: spids: [2122 2128] ) } spids: [2121] ) ] spids: [2119] ) (C {(echo)} { (DQ ("| ") (EscapedLiteralPart token:) ("LAST2 | ") (${ VSub_Name format_last2) (" |") ) } ) (C {(echo)} { (DQ ( "=================================================================" ) ) } ) (C {(echo)}) ] spids: [-1 1989] ) ] else_action: [ (C {(echo)} {(DQ (${ VSub_Name branch_trunkdart_old) (" not found"))}) (C {(echo)}) ] spids: [2154 2170] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:branch_trunkdart_new) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(trunkdart_name)} {(${ VSub_Name do_new_branch)})] ) left_token: spids: [2179 2185] ) } spids: [2178] ) ] spids: [2178] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:new_branch_found) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(trunk_exist)} {(${ VSub_Name do_new_branch)})] ) left_token: spids: [2189 2195] ) } spids: [2188] ) ] spids: [2188] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$new_branch_found"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(hash_trunk_revision)} {(${ VSub_Name do_new_revision)}) (C {(echo)} { (DQ ( "=================================================================" ) ) } ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:format_branch) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(space_pad)} {($ VSub_Name "$branch_trunkdart_new")} {(32)} {(1)} ) ] ) left_token: spids: [2239 2247] ) } spids: [2238] ) ] spids: [2236] ) (C {(echo)} { (DQ ("| ") (EscapedLiteralPart token:) ("NEW ") (${ VSub_Name format_which) (" dart") (${ VSub_Name do_new_branch) ("@") (${ VSub_Name do_new_revision) (${ VSub_Name format_branch) (" |") ) } ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:remote_url) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(url_branch)} {($ VSub_Name "$branch_trunkdart_new")}) ] ) left_token: spids: [2277 2281] ) } spids: [2276] ) ] spids: [2274] ) (C {(echo)} { (DQ (CommandSubPart command_list: (CommandList children: [(C {(display_url)} {($ VSub_Name "$remote_url")})] ) left_token: spids: [2287 2291] ) ) } ) (C {(echo)} { (DQ ( "|---------------------------------------------------------------|" ) ) } ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:revision) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(last_revision)} {($ VSub_Name "$branch_trunkdart_new")} ) ] ) left_token: spids: [2305 2309] ) } spids: [2304] ) ] spids: [2302] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:format_revision) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(space_pad)} {($ VSub_Name "$revision")} {(43)}) ] ) left_token: spids: [2315 2321] ) } spids: [2314] ) ] spids: [2312] ) (C {(echo)} {(DQ ("| last revision | ") (${ VSub_Name format_revision) (" |"))} ) (C {(echo)} { (DQ ( "=================================================================" ) ) } ) (C {(echo)}) ] spids: [-1 2215] ) ] else_action: [ (C {(echo)} {(DQ (${ VSub_Name branch_trunkdart_new) (" not found"))}) (C {(echo)}) ] spids: [2345 2361] ) ] spids: [-1 1707] ) ] spids: [-1 2364] ) ] spids: [1689] ) spids: [1685 1688] ) (FuncDef name: switch_branch body: (BraceGroup children: [ (C { (CommandSubPart command_list: (CommandList children: [(C {(git)} {(checkout)} {(${ VSub_Number 1)} {(--quiet)})] ) left_token: spids: [2379 2389] ) } ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:curr_branch) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(git)} {(name-rev)} {(--name-only)} {(HEAD)})] ) left_token: spids: [2395 2403] ) } spids: [2394] ) ] spids: [2392] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ ($ VSub_Name "$curr_branch"))} right: {(DQ ($ VSub_Number "$1"))} ) ) terminator: ) ] action: [ (C { (CommandSubPart command_list: (CommandList children: [ (C {(display_error)} { (DQ ("Unable to switch to branch ") ($ VSub_Number "$1") (" - pending commits/add?") ) } ) ] ) left_token: spids: [2426 2434] ) } ) (C {(exit)} {(-1)}) ] spids: [-1 2423] ) ] spids: [-1 2442] ) (C {(echo)} {($ VSub_Name "$curr_branch")}) ] spids: [2376] ) spids: [2370 2375] ) (FuncDef name: check_branch body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:old_branch) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(git)} {(name-rev)} {(--name-only)} {(HEAD)})] ) left_token: spids: [2486 2494] ) } spids: [2485] ) ] spids: [2483] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:curr_branch) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(switch_branch)} {($ VSub_Number "$1")})] ) left_token: spids: [2500 2504] ) } spids: [2499] ) ] spids: [2497] ) (Sentence child: (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:trunk_url) op:Equal spids:[2509])] spids: [2507] ) terminator: ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$do_which"))} {(Lit_Other "=")} {(DQ (chrome))} {(Lit_Other "]")} ) terminator: ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:trunk_url) op: Equal rhs: {(SQ <"Committing to svn://svn.chromium.org/chrome/trunk/src ...">)} spids: [2538] ) ] spids: [2538] ) ] spids: [-1 2531] ) (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$do_which"))} {(Lit_Other "=")} {(DQ (blink))} {(Lit_Other "]")} ) terminator: ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:trunk_url) op: Equal rhs: {(SQ <"Committing to svn://svn.chromium.org/blink/trunk ...">)} spids: [2568] ) ] spids: [2568] ) ] spids: [2544 2561] ) ] else_action: [ (C { (CommandSubPart command_list: (CommandList children: [(C {(display_error)} {(DQ ("Neither blink or chrome specified"))})] ) left_token: spids: [2577 2583] ) } ) (C {(exit)} {(-1)}) ] spids: [2574 2591] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:remote_commit) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(git)} {(svn)} {(dcommit)} {(--dry-run)}) (C {(head)} {(-1)}) (C {(grep)} {(DQ (${ VSub_Name trunk_url))}) ] negated: False ) ] ) left_token: spids: [2598 2622] ) } spids: [2597] ) ] spids: [2595] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:curr_branch) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(switch_branch)} {($ VSub_Name "$old_branch")})] ) left_token: spids: [2627 2631] ) } spids: [2626] ) ] spids: [2626] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ ($ VSub_Name "$curr_branch"))} right: {(DQ ($ VSub_Name "$old_branch"))} ) ) terminator: ) ] action: [ (C { (CommandSubPart command_list: (CommandList children: [ (C {(display_error)} { (DQ ("Unable to switch back to original branch ") (${ VSub_Name old_branch) ) } ) ] ) left_token: spids: [2654 2663] ) } ) (C {(exit)} {(-1)}) ] spids: [-1 2651] ) ] spids: [-1 2671] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ ($ VSub_Name "$remote_commit"))} right: {(DQ )} ) ) terminator: ) ] action: [ (C { (CommandSubPart command_list: (CommandList children: [ (C {(display_error)} { (DQ ("Branch ") (${ VSub_Number 1) ( " is NOT pointing to the Dart branch repository but pointing to trunk." ) ) } ) ] ) left_token: spids: [2694 2704] ) } ) (C {(exit)} {(-1)}) ] spids: [-1 2691] ) ] spids: [-1 2712] ) (C {(echo)} { (DQ ("Local branch '") (${ VSub_Number 1) ("' is based on the remote branch/dart repository.") ) } ) ] spids: [2480] ) spids: [2474 2479] ) (FuncDef name: valid_branch_url body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:src_dir) op:Equal rhs:{(DQ )} spids:[2774])] spids: [2772] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobEqual left: {(DQ ($ VSub_Name "$do_which"))} right: {(DQ (chrome))} ) ) terminator: ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:src_dir) op: Equal rhs: {(DQ (/src))} spids: [2799] ) ] spids: [2799] ) ] spids: [-1 2796] ) ] spids: [-1 2805] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:old_remote) op: Equal rhs: { (DQ ("svn://svn.chromium.org/") (${ VSub_Name do_which) (/branches/dart/) (${ VSub_Name do_old_branch) (${ VSub_Name src_dir) ) } spids: [2810] ) ] spids: [2808] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:new_remote) op: Equal rhs: { (DQ ("svn://svn.chromium.org/") (${ VSub_Name do_which) (/branches/dart/) (${ VSub_Name do_new_branch) (${ VSub_Name src_dir) ) } spids: [2828] ) ] spids: [2826] ) (C {(echo)} { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Number "$1"))}) (C {(grep)} {(-e)} {(DQ (${ VSub_Name old_remote))} {(-e)} {(DQ (${ VSub_Name new_remote))} ) ] negated: False ) ] ) left_token: spids: [2847 2873] ) } ) ] spids: [2745] ) spids: [2739 2744] ) (FuncDef name: url_branch body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:old_branch) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(git)} {(name-rev)} {(--name-only)} {(HEAD)})] ) left_token: spids: [2897 2905] ) } spids: [2896] ) ] spids: [2894] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:curr_branch) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(switch_branch)} {($ VSub_Number "$1")})] ) left_token: spids: [2911 2915] ) } spids: [2910] ) ] spids: [2908] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:remote_commit) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(git)} {(svn)} {(dcommit)} {(--dry-run)}) (C {(head)} {(-1)}) (C {(sed)} {(SQ <"s/Committing to //">)}) (C {(sed)} {(SQ <"s/ ...//">)}) ] negated: False ) ] ) left_token: spids: [2922 2952] ) } spids: [2921] ) ] spids: [2919] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:curr_branch) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(switch_branch)} {($ VSub_Name "$old_branch")})] ) left_token: spids: [2957 2961] ) } spids: [2956] ) ] spids: [2956] ) (C {(echo)} {(DQ (${ VSub_Name remote_commit))}) ] spids: [2891] ) spids: [2885 2890] ) (FuncDef name: validate_branches body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:stripped_found) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(stripped_exist)})]) left_token: spids: [2999 3001] ) } spids: [2998] ) ] spids: [2996] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$stripped_found"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:branch_name) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(stripped_name)})]) left_token: spids: [3027 3029] ) } spids: [3026] ) ] spids: [3024] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:check_result) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(check_branch)} {(${ VSub_Name branch_name)})] ) left_token: spids: [3035 3041] ) } spids: [3034] ) ] spids: [3032] ) (C {(printf)} {(DQ ("%s") (EscapedLiteralPart token:))} {(DQ ($ VSub_Name "$check_result"))} ) ] spids: [-1 3021] ) ] spids: [-1 3056] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:branch_trunkdart_old) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(trunkdart_name)} {(${ VSub_Name do_old_branch)})] ) left_token: spids: [3067 3073] ) } spids: [3066] ) ] spids: [3064] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:old_branch_found) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(trunk_exist)} {(${ VSub_Name do_old_branch)})] ) left_token: spids: [3079 3085] ) } spids: [3078] ) ] spids: [3076] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$old_branch_found"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:check_result) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(check_branch)} {($ VSub_Name "$branch_trunkdart_old")}) ] ) left_token: spids: [3111 3115] ) } spids: [3110] ) ] spids: [3108] ) (C {(printf)} {(DQ ("%s") (EscapedLiteralPart token:))} {(DQ ($ VSub_Name "$check_result"))} ) ] spids: [-1 3105] ) ] spids: [-1 3130] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:branch_trunkdart_new) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(trunkdart_name)} {(${ VSub_Name do_new_branch)})] ) left_token: spids: [3141 3147] ) } spids: [3140] ) ] spids: [3138] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:new_branch_found) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(trunk_exist)} {(${ VSub_Name do_new_branch)})] ) left_token: spids: [3153 3159] ) } spids: [3152] ) ] spids: [3150] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$new_branch_found"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:check_result) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(check_branch)} {($ VSub_Name "$branch_trunkdart_new")}) ] ) left_token: spids: [3185 3189] ) } spids: [3184] ) ] spids: [3182] ) (C {(printf)} {(DQ ("%s") (EscapedLiteralPart token:))} {(DQ ($ VSub_Name "$check_result"))} ) ] spids: [-1 3179] ) ] spids: [-1 3204] ) ] spids: [2989] ) spids: [2983 2988] ) (FuncDef name: display_roll_commands body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$roll_branches"))} {(Lit_Other "=")} {(1)} {(Lit_Other "]")} ) terminator: ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$do_which"))} {(Lit_Other "=")} {(DQ (chrome))} {(Lit_Other "]")} ) terminator: ) ] action: [(C {(roll_chrome_commands)})] spids: [-1 3254] ) (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$do_which"))} {(Lit_Other "=")} {(DQ (blink))} {(Lit_Other "]")} ) terminator: ) ] action: [(C {(roll_blink_commands)})] spids: [3260 3277] ) ] spids: [-1 3283] ) ] spids: [-1 3234] ) ] spids: [-1 3286] ) ] spids: [3216] ) spids: [3210 3215] ) (FuncDef name: display_remote_repository_creation body: (BraceGroup children: [ (C {(echo)} {(DQ ("Do the following pre-roll setup"))}) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$do_which"))} {(Lit_Other "=")} {(DQ (chrome))} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(echo)} {(DQ (" mkdir dartium-") (${ VSub_Name do_new_branch))}) (C {(echo)} {(DQ (" cd dartium-") (${ VSub_Name do_new_branch))}) (C {(echo)} { (DQ (" svn mkdir -m ") (EscapedLiteralPart token:) ("Preparing Chrome 35/") (${ VSub_Name do_new_branch) (" branch") (EscapedLiteralPart token:) (" ") ) } {(DQ ("svn://svn.chromium.org/chrome/branches/dart/") (${ VSub_Name do_new_branch))} ) (C {(echo)} { (DQ (" svn cp -m ") (EscapedLiteralPart token:) ("Branching for ") (${ VSub_Name do_new_branch) (" @") (${ VSub_Name do_new_revision) (EscapedLiteralPart token: ) (" ") ) } {(DQ ("svn://svn.chromium.org/chrome/trunk/src@") (${ VSub_Name do_new_revision) (" "))} { (DQ ("svn://svn.chromium.org/chrome/branches/dart/") (${ VSub_Name do_new_branch) (/src) ) } ) (C {(echo)} {(DQ (" git svn clone -r241107 svn://svn.chromium.org/chrome/trunk/src src"))} ) (C {(echo)}) (C {(echo)} {(DQ (" cd src"))}) (C {(echo)} {(DQ (" git cl rebase"))}) (C {(echo)}) (C {(echo)} {(DQ ("-----After rebase finishes-----"))}) (C {(echo)}) (C {(echo)} {(DQ (" 1. Add the below lines to src/.git/config"))}) (C {(echo)}) (C {(echo)} { (DQ ("[svn-remote ") (EscapedLiteralPart token:) (dart) (${ VSub_Name do_old_branch) (EscapedLiteralPart token:) ("]") ) } ) (C {(echo)} { (DQ (" url = svn://svn.chromium.org/chrome/branches/dart/") (${ VSub_Name do_old_branch) (/src) ) } ) (C {(echo)} {(DQ (" fetch = :refs/remotes/dart") (${ VSub_Name do_old_branch))}) (C {(echo)} { (DQ ("[svn-remote ") (EscapedLiteralPart token:) (dart) (${ VSub_Name do_new_branch) (EscapedLiteralPart token:) ("]") ) } ) (C {(echo)} { (DQ (" url = svn://svn.chromium.org/chrome/branches/dart/") (${ VSub_Name do_new_branch) (/src) ) } ) (C {(echo)} {(DQ (" fetch = :refs/remotes/dart") (${ VSub_Name do_new_branch))}) (C {(echo)}) (C {(echo)} {(DQ (" 2. Get the code"))}) (C {(echo)}) (C {(echo)} {(DQ (" cd src"))}) (C {(echo)} { (DQ (" git svn fetch dart") (${ VSub_Name do_old_branch) (" && git svn fetch dart") (${ VSub_Name do_new_branch) ) } ) ] spids: [-1 3343] ) (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$do_which"))} {(Lit_Other "=")} {(DQ (blink))} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(echo)} {(DQ (" Directory dartium-") (${ VSub_Name do_new_branch) (" exists."))} ) (C {(echo)} {(DQ (" cd dartium-") (${ VSub_Name do_new_branch))}) (C {(echo)} { (DQ (" svn cp -m ") (EscapedLiteralPart token:) ("Branching ") (${ VSub_Name do_new_branch) (" @") (${ VSub_Name do_new_revision) (EscapedLiteralPart token: ) (" ") ) } {(DQ ("svn://svn.chromium.org/blink/trunk@") (${ VSub_Name do_new_revision) (" "))} { (DQ ("svn://svn.chromium.org/blink/branches/dart/") (${ VSub_Name do_new_branch) ) } ) (C {(echo)} {(DQ (" git svn clone --trunk=trunk --branches=branches/dart"))} {(DQ (" --prefix=blink-svn/ -r165883:HEAD "))} {(DQ ("svn://svn.chromium.org/blink src/third_party/WebKit"))} ) (C {(echo)}) (C {(echo)} {(DQ (" cd src/third_party/WebKit"))}) (C {(echo)} {(DQ (" git cl rebase"))}) (C {(echo)}) (C {(echo)} {(DQ ("-----After rebase finishes-----"))}) (C {(echo)}) (C {(echo)} {(DQ (" 1. Add the below lines to src/third_party/WebKit/.git/config"))}) (C {(echo)}) (C {(echo)} { (DQ ("[svn-remote ") (EscapedLiteralPart token:) (dart) (${ VSub_Name do_old_branch) (EscapedLiteralPart token:) ("]") ) } ) (C {(echo)} { (DQ (" url = svn://svn.chromium.org/blink/branches/dart/") (${ VSub_Name do_old_branch) ) } ) (C {(echo)} {(DQ (" fetch = :refs/remotes/dart") (${ VSub_Name do_old_branch))}) (C {(echo)} { (DQ ("[svn-remote ") (EscapedLiteralPart token:) (dart) (${ VSub_Name do_new_branch) (EscapedLiteralPart token:) ("]") ) } ) (C {(echo)} { (DQ (" url = svn://svn.chromium.org/blink/branches/dart/") (${ VSub_Name do_new_branch) ) } ) (C {(echo)} {(DQ (" fetch = :refs/remotes/dart") (${ VSub_Name do_new_branch))}) (C {(echo)}) (C {(echo)} {(DQ (" 2. Get the code"))}) (C {(echo)}) (C {(echo)} {(DQ (" cd src/third_party/WebKit"))}) (C {(echo)} { (DQ (" git svn fetch dart") (${ VSub_Name do_old_branch) (" && git svn fetch dart") (${ VSub_Name do_new_branch) ) } ) ] spids: [3576 3593] ) ] spids: [-1 3817] ) ] spids: [3301] ) spids: [3295 3300] ) (FuncDef name: roll_chrome_commands body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:stripped_found) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(stripped_exist)})]) left_token: spids: [4243 4245] ) } spids: [4242] ) ] spids: [4242] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:old_branch_found) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(trunk_exist)} {(${ VSub_Name do_old_branch)})] ) left_token: spids: [4249 4255] ) } spids: [4248] ) ] spids: [4248] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:new_branch_found) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(trunk_exist)} {(${ VSub_Name do_new_branch)})] ) left_token: spids: [4259 4265] ) } spids: [4258] ) ] spids: [4258] ) (C {(echo)}) (C {(echo)} {(DQ ("================================================"))}) (C {(echo)} {(DQ ("| git commands to run: |"))}) (C {(echo)} {(DQ ("================================================"))}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:remoteOld) op: Equal rhs: {(dart) (${ VSub_Name do_old_branch)} spids: [4294] ) ] spids: [4294] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:strip_branch) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(stripped_name)})]) left_token: spids: [4302 4304] ) } spids: [4301] ) ] spids: [4301] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$stripped_found"))} {(Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(echo)} {(DQ ("------------------ Step 1. ---------------------"))}) (C {(echo)}) (C {(echo)} { (DQ ("git checkout -b ") (${ VSub_Name strip_branch) (" ") (${ VSub_Name remoteOld) ) } ) (C {(hash_codes_base_last)} {(${ VSub_Name remoteOld)}) (C {(echo)} {(DQ ("git rebase -i ") (${ VSub_Name hash_base))}) (C {(echo)}) ] spids: [-1 4324] ) (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$old_branch_found"))} {(Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(echo)} {(DQ ("------------------ Step 2. ---------------------"))}) (C {(echo)}) (C {(hash_codes_base_last)} {(${ VSub_Name strip_branch)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:branch_trunkdart_old) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(trunkdart_name)} {(${ VSub_Name do_old_branch)})] ) left_token: spids: [4437 4443] ) } spids: [4436] ) ] spids: [4436] ) (C {(echo)} { (DQ ("git checkout -b ") (${ VSub_Name branch_trunkdart_old) (" ") (${ VSub_Name hash_base) ) } ) (C {(echo)} { (DQ ("git cherry-pick ") (${ VSub_Name hash_base) (..) (${ VSub_Name hash_last)) } ) (C {(echo)}) ] spids: [4382 4398] ) (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$new_branch_found"))} {(Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(echo)} {(DQ ("------------------ Step 3. ---------------------"))}) (C {(echo)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:branch_trunkdart_new) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(trunkdart_name)} {(${ VSub_Name do_new_branch)})] ) left_token: spids: [4513 4519] ) } spids: [4512] ) ] spids: [4512] ) (C {(hash_codes_base2_last2)} {(${ VSub_Name branch_trunkdart_old)}) (C {(echo)} { (DQ ("git checkout -b ") (${ VSub_Name branch_trunkdart_new) (" ") (${ VSub_Name remoteOld) ) } ) (C {(echo)} { (DQ ("git cherry-pick ") (${ VSub_Name hash_base2) (..) (${ VSub_Name hash_last2) ) } ) (C {(echo)}) ] spids: [4478 4494] ) ] else_action: [(C {(echo)} {(DQ ("===== Nothing to do - Roll setup complete. ====="))})] spids: [4567 4577] ) (C {(echo)} {(DQ ("================================================"))}) ] spids: [4239] ) spids: [4233 4238] ) (FuncDef name: roll_blink_commands body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:stripped_found) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(stripped_exist)})]) left_token: spids: [4601 4603] ) } spids: [4600] ) ] spids: [4600] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:old_branch_found) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(trunk_exist)} {(${ VSub_Name do_old_branch)})] ) left_token: spids: [4607 4613] ) } spids: [4606] ) ] spids: [4606] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:new_branch_found) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(trunk_exist)} {(${ VSub_Name do_new_branch)})] ) left_token: spids: [4617 4623] ) } spids: [4616] ) ] spids: [4616] ) (C {(echo)}) (C {(echo)} {(DQ ("================================================"))}) (C {(echo)} {(DQ ("| git commands to run: |"))}) (C {(echo)} {(DQ ("================================================"))}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:remoteOld) op: Equal rhs: {(dart) (${ VSub_Name do_old_branch)} spids: [4652] ) ] spids: [4652] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:strip_branch) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(stripped_name)})]) left_token: spids: [4660 4662] ) } spids: [4659] ) ] spids: [4659] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$stripped_found"))} {(Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(echo)} {(DQ ("------------------ Step 1. ---------------------"))}) (C {(echo)}) (C {(echo)} { (DQ ("git checkout -b ") (${ VSub_Name strip_branch) (" ") (${ VSub_Name remoteOld) ) } ) (C {(hash_codes_base_last)} {(${ VSub_Name remoteOld)}) (C {(eho)} {(DQ ("git rebase -i ") (${ VSub_Name hash_base))}) (C {(echo)}) ] spids: [-1 4682] ) (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$old_branch_found"))} {(Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(echo)} {(DQ ("------------------ Step 2. ---------------------"))}) (C {(echo)}) (C {(hash_codes_base_last)} {(${ VSub_Name strip_branch)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:branch_trunkdart_old) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(trunkdart_name)} {(${ VSub_Name do_old_branch)})] ) left_token: spids: [4795 4801] ) } spids: [4794] ) ] spids: [4794] ) (C {(echo)} { (DQ ("git checkout -b ") (${ VSub_Name branch_trunkdart_old) (" ") (${ VSub_Name hash_base) ) } ) (C {(echo)} { (DQ ("git cherry-pick ") (${ VSub_Name hash_base) (..) (${ VSub_Name hash_last)) } ) (C {(echo)}) ] spids: [4740 4756] ) (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$new_branch_found"))} {(Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(echo)} {(DQ ("------------------ Step 3. ---------------------"))}) (C {(echo)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:branch_trunkdart_new) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(trunkdart_name)} {(${ VSub_Name do_new_branch)})] ) left_token: spids: [4872 4878] ) } spids: [4871] ) ] spids: [4871] ) (C {(hash_codes_base2_last2)} {(${ VSub_Name branch_trunkdart_old)}) (C {(echo)} { (DQ ("git checkout -b ") (${ VSub_Name branch_trunkdart_new) (" ") (${ VSub_Name remoteOld) ) } ) (C {(echo)} { (DQ ("git cherry-pick ") (${ VSub_Name hash_base2) (..) (${ VSub_Name hash_last2) ) } ) (C {(echo)}) ] spids: [4836 4852] ) ] else_action: [(C {(echo)} {(DQ ("===== Nothing to do - Roll setup complete. ====="))})] spids: [4926 4936] ) (C {(echo)} {(DQ ("================================================"))}) ] spids: [4597] ) spids: [4591 4596] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:create_branches) op:Equal rhs:{(0)} spids:[4953])] spids: [4953] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:do_info_hashes) op:Equal rhs:{(0)} spids:[4957])] spids: [4957] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:base_dir) op:Equal rhs:{(DQ )} spids:[4961])] spids: [4961] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:do_pre_roll) op:Equal rhs:{(0)} spids:[4969])] spids: [4969] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:do_which) op:Equal rhs:{(DQ )} spids:[4976])] spids: [4976] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:do_verbose) op:Equal rhs:{(0)} spids:[4984])] spids: [4984] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:do_old_branch) op:Equal rhs:{(DQ )} spids:[4991])] spids: [4991] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:do_old_revision) op:Equal rhs:{(DQ )} spids:[4995])] spids: [4995] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:do_new_branch) op:Equal rhs:{(DQ )} spids:[5003])] spids: [5003] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:do_new_revision) op:Equal rhs:{(DQ )} spids:[5007])] spids: [5007] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:curr_switch) op:Equal rhs:{(DQ )} spids:[5012])] spids: [5012] ) (ForEach iter_name: var iter_words: [{(DQ ($ VSub_At "$@"))}] do_arg_iter: False body: (DoGroup children: [ (Case to_match: {(DQ ($ VSub_Name "$var"))} arms: [ (case_arm pat_list: [{(--help)}] action: [(C {(usage)}) (C {(exit)})] spids: [5038 5039 5048 -1] ) (case_arm pat_list: [{(--verbose)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:do_verbose) op: Equal rhs: {(1)} spids: [5055] ) ] spids: [5055] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:curr_switch) op: Equal rhs: {(DQ )} spids: [5059] ) ] spids: [5059] ) ] spids: [5051 5052 5064 -1] ) (case_arm pat_list: [{(--no-verbose)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:do_verbose) op: Equal rhs: {(0)} spids: [5071] ) ] spids: [5071] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:curr_switch) op: Equal rhs: {(DQ )} spids: [5075] ) ] spids: [5075] ) ] spids: [5067 5068 5080 -1] ) (case_arm pat_list: [{(--chrome)}] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$do_which"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C { (CommandSubPart command_list: (CommandList children: [ (C {(display_error)} {(DQ ("--chrome can not be specified with --blink"))} ) ] ) left_token: spids: [5107 5113] ) } ) (C {(exit)} {($ VSub_Name "$E_INVALID_ARG")}) ] spids: [-1 5104] ) ] spids: [-1 5121] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:do_which) op: Equal rhs: {(DQ (chrome))} spids: [5124] ) ] spids: [5124] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:curr_switch) op: Equal rhs: {(DQ )} spids: [5130] ) ] spids: [5130] ) ] spids: [5083 5084 5135 -1] ) (case_arm pat_list: [{(--blink)}] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$do_which"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C { (CommandSubPart command_list: (CommandList children: [ (C {(display_error)} {(DQ ("--blink can not be specified with --chrome"))} ) ] ) left_token: spids: [5162 5168] ) } ) (C {(exit)} {($ VSub_Name "$E_INVALID_ARG")}) ] spids: [-1 5159] ) ] spids: [-1 5176] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:do_which) op: Equal rhs: {(DQ (blink))} spids: [5179] ) ] spids: [5179] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:curr_switch) op: Equal rhs: {(DQ )} spids: [5185] ) ] spids: [5185] ) ] spids: [5138 5139 5190 -1] ) (case_arm pat_list: [{(--pre-roll)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:do_pre_roll) op: Equal rhs: {(1)} spids: [5197] ) ] spids: [5197] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:curr_switch) op: Equal rhs: {(DQ )} spids: [5201] ) ] spids: [5201] ) ] spids: [5193 5194 5206 -1] ) (case_arm pat_list: [{(--roll)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:roll_branches) op: Equal rhs: {(1)} spids: [5213] ) ] spids: [5213] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:curr_switch) op: Equal rhs: {(DQ )} spids: [5217] ) ] spids: [5217] ) ] spids: [5209 5210 5222 -1] ) (case_arm pat_list: [{(--info)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:do_info_hashes) op: Equal rhs: {(1)} spids: [5229] ) ] spids: [5229] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:curr_switch) op: Equal rhs: {(DQ )} spids: [5233] ) ] spids: [5233] ) ] spids: [5225 5226 5238 -1] ) (case_arm pat_list: [{(--directory)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:curr_switch) op: Equal rhs: {(DQ (base-directory))} spids: [5245] ) ] spids: [5245] ) ] spids: [5241 5242 5254 -1] ) (case_arm pat_list: [{(--old-branch)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:curr_switch) op: Equal rhs: {(DQ (old-branch))} spids: [5261] ) ] spids: [5261] ) ] spids: [5257 5258 5270 -1] ) (case_arm pat_list: [{(--new-branch)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:curr_switch) op: Equal rhs: {(DQ (new-branch))} spids: [5277] ) ] spids: [5277] ) ] spids: [5273 5274 5286 -1] ) (case_arm pat_list: [{(--old-revision)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:curr_switch) op: Equal rhs: {(DQ (old-revision))} spids: [5293] ) ] spids: [5293] ) ] spids: [5289 5290 5302 -1] ) (case_arm pat_list: [{(--new-revision)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:curr_switch) op: Equal rhs: {(DQ (new-revision))} spids: [5309] ) ] spids: [5309] ) ] spids: [5305 5306 5318 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:prefix) op: Equal rhs: { (BracedVarSub token: suffix_op: (Slice begin: (ArithWord w:{(Lit_Digits 0)}) length: (ArithWord w:{(Lit_Digits 2)}) ) spids: [5326 5332] ) } spids: [5325] ) ] spids: [5325] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$prefix"))} {(Lit_Other "=")} {(DQ (--))} {(Lit_Other "]")} ) terminator: ) ] action: [ (C { (CommandSubPart command_list: (CommandList children: [ (C {(display_error)} {(DQ ("unexpected switch ") (${ VSub_Name var))} ) ] ) left_token: spids: [5355 5364] ) } ) (C {(exit)} {($ VSub_Name "$E_INVALID_ARG")}) ] spids: [-1 5352] ) ] spids: [-1 5372] ) (Case to_match: {(DQ ($ VSub_Name "$curr_switch"))} arms: [ (case_arm pat_list: [{(base-directory)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:base_dir) op: Equal rhs: {(DQ (${ VSub_Name var))} spids: [5388] ) ] spids: [5388] ) ] spids: [5384 5385 5396 -1] ) (case_arm pat_list: [{(old-branch)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:do_old_branch) op: Equal rhs: {(DQ (${ VSub_Name var))} spids: [5403] ) ] spids: [5403] ) ] spids: [5399 5400 5411 -1] ) (case_arm pat_list: [{(old-revision)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:do_old_revision) op: Equal rhs: {(DQ (${ VSub_Name var))} spids: [5418] ) ] spids: [5418] ) ] spids: [5414 5415 5426 -1] ) (case_arm pat_list: [{(new-branch)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:do_new_branch) op: Equal rhs: {(DQ (${ VSub_Name var))} spids: [5433] ) ] spids: [5433] ) ] spids: [5429 5430 5441 -1] ) (case_arm pat_list: [{(new-revision)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:do_new_revision) op: Equal rhs: {(DQ (${ VSub_Name var))} spids: [5448] ) ] spids: [5448] ) ] spids: [5444 5445 5456 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$curr_switch"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C { (CommandSubPart command_list: (CommandList children: [ (C {(display_error)} { (DQ ("unexpected paramter for ") (${ VSub_Name curr_switch) ) } ) ] ) left_token: spids: [5483 5492] ) } ) (C {(exit)} {($ VSub_Name "$E_INVALID_ARG")}) ] spids: [-1 5480] ) ] else_action: [ (C { (CommandSubPart command_list: (CommandList children: [ (C {(display_error)} {(DQ ("unexpected switch ") (${ VSub_Name var))} ) ] ) left_token: spids: [5503 5512] ) } ) (C {(exit)} {($ VSub_Name "$E_INVALID_ARG")}) ] spids: [5500 5520] ) ] spids: [5459 5460 5523 -1] ) ] spids: [5375 5381 5526] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:curr_switch) op: Equal rhs: {(DQ )} spids: [5529] ) ] spids: [5529] ) ] spids: [5321 5322 5534 -1] ) ] spids: [5029 5035 5537] ) ] spids: [5026 5539] ) spids: [5021 -1] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$base_dir"))} {(Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(echo)} {(DQ ("--directory switch must be specified."))}) (C {(exit)} {($ VSub_Name "$E_INVALID_ARG")}) ] spids: [-1 5561] ) ] spids: [-1 5575] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$do_which"))} {(Lit_Other "=") (Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(echo)} {(DQ ("--chrome or --blink switch must be specified."))}) (C {(exit)} {($ VSub_Name "$E_INVALID_ARG")}) ] spids: [-1 5595] ) ] spids: [-1 5609] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$do_old_branch"))} {(Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(echo)} { (DQ ("Enter LAST ") (${ VSub_Name do_which) (" true branch (e.g., Chrome version 34.0.1847.92 true branch is 1847)") ) } ) (C {(read)} {(do_old_branch)}) ] spids: [-1 5628] ) ] spids: [-1 5646] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$do_old_revision"))} {(Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(echo)} {(DQ ("Enter LAST ") (${ VSub_Name do_which) (" base trunk revision #"))}) (C {(read)} {(do_old_revision)}) ] spids: [-1 5665] ) ] spids: [-1 5683] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$do_new_branch"))} {(Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(echo)} { (DQ ("Enter NEW ") (${ VSub_Name do_which) (" true branch (e.g., Chrome version 35.0.1908.4 true branch is 1908)") ) } ) (C {(read)} {(do_new_branch)}) ] spids: [-1 5702] ) ] spids: [-1 5720] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$do_new_revision"))} {(Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(echo)} {(DQ ("Enter NEW ") (${ VSub_Name do_which) (" base trunk revision #"))}) (C {(read)} {(do_new_revision)}) ] spids: [-1 5739] ) ] spids: [-1 5757] ) (C {(echo)}) (C {(echo)} { (DQ ("Rolling new branch ") (${ VSub_Name do_new_branch) ("@") (${ VSub_Name do_new_revision)) } ) (C {(verbose_message)}) (C {(verbose_message)} {(DQ ("Previous branch ") (${ VSub_Name do_old_branch) ("@") (${ VSub_Name do_old_revision))} ) (C {(verbose_message)} {(DQ ("New branch ") (${ VSub_Name do_new_branch) ("@") (${ VSub_Name do_new_revision))} ) (C {(verbose_message)}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobEqual left: {(DQ ($ VSub_Name "$do_pre_roll"))} right: {(DQ (1))} ) ) terminator: ) ] action: [(C {(display_remote_repository_creation)}) (C {(exit)} {(1)})] spids: [-1 5824] ) ] spids: [-1 5834] ) (SimpleCommand words: [{(pushd)} {(.)}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[5841])] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$base_dir"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ )} {(Lit_Other "]")} ) terminator: ) ] action: [(C {(cd)} {(${ VSub_Name base_dir)})] spids: [-1 5863] ) ] spids: [-1 5872] ) (C {(cd)} {(src)}) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$do_which"))} {(Lit_Other "=")} {(DQ (blink))} {(Lit_Other "]")} ) terminator: ) ] action: [(C {(cd)} {(third_party/WebKit)})] spids: [-1 5897] ) ] spids: [-1 5904] ) (C {(trap)} {(SQ )} {(INT)}) (C {(trap)} {(SQ )} {(TSTP)}) (C {(validate_remotes)}) (C {(display_roll_commands)}) (C {(display_hashes)}) (C {(validate_branches)}) (C {(trap)} {(-)} {(INT)}) (C {(trap)} {(-)} {(TSTP)}) (SimpleCommand words: [{(popd)}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[5961])] ) ] )