Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright 2013 the V8 project authors. All rights reserved. | 2 # Copyright 2013 the V8 project authors. All rights reserved. |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following | 10 # copyright notice, this list of conditions and the following |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | 28 |
| 29 | 29 |
| 30 ########## Global variable definitions | 30 ########## Global variable definitions |
| 31 | 31 |
| 32 BASE_URL="https://code.google.com/p/v8/source/list" | |
| 32 VERSION="src/version.cc" | 33 VERSION="src/version.cc" |
| 33 MAJOR="MAJOR_VERSION" | 34 MAJOR="MAJOR_VERSION" |
| 34 MINOR="MINOR_VERSION" | 35 MINOR="MINOR_VERSION" |
| 35 BUILD="BUILD_NUMBER" | 36 BUILD="BUILD_NUMBER" |
| 36 PATCH="PATCH_LEVEL" | 37 PATCH="PATCH_LEVEL" |
| 37 | 38 |
| 38 V8="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | 39 V8="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" |
| 39 | 40 |
| 40 ########## Function definitions | 41 ########## Function definitions |
| 41 | 42 |
| 42 cd $V8 | 43 cd $V8 |
| 43 | 44 |
| 44 usage() { | 45 usage() { |
| 45 cat << EOF | 46 cat << EOF |
| 46 usage: $0 OPTIONS | 47 usage: $0 OPTIONS |
| 47 | 48 |
| 48 Fetches V8 revision information from a git-svn checkout. | 49 Fetches V8 revision information from a git-svn checkout. |
| 49 | 50 |
| 50 OPTIONS: | 51 OPTIONS: |
| 51 -h Show this message. | 52 -h Show this message. |
| 53 | |
| 52 -i Print revision info for all branches matching the V8 version. | 54 -i Print revision info for all branches matching the V8 version. |
| 55 Example usage: <v8-info> -i 3.19.10$ | |
|
Jakob Kummerow
2013/06/12 12:02:23
You can s/<v8-info>/$0/, it should resolve to the
Toon Verwaest
2013/06/12 15:35:48
Done.
| |
| 56 Output format: [Git hash] [SVN revision] [V8 version] | |
| 57 | |
| 53 -v Print the V8 version tag for a trunk SVN revision. | 58 -v Print the V8 version tag for a trunk SVN revision. |
| 59 Example usage: <v8-info> -v 14981 | |
| 60 Output format: [V8 version] | |
| 61 | |
| 54 -m Print all patches that were merged to the specified V8 branch. | 62 -m Print all patches that were merged to the specified V8 branch. |
| 63 Example usage: <v8-info> -m 3.18 | |
| 64 Output format: [V8 version] [SVN revision] [SVN patch merged]*. | |
| 65 | |
| 55 -p Print all patches merged to a specific V8 point-release. | 66 -p Print all patches merged to a specific V8 point-release. |
| 67 Example usage: <v8-info> -p 3.19.12.1 | |
| 68 Output format: [SVN patch merged]* | |
| 69 | |
| 70 -u Print a link to all SVN revisions between two V8 revision tags. | |
| 71 Example usage: <v8-info> -u 3.19.10:3.19.11 | |
| 56 EOF | 72 EOF |
| 57 } | 73 } |
| 58 | 74 |
| 59 tags() { | 75 tags() { |
| 60 git for-each-ref --format="%(objectname) %(refname:short)" refs/remotes/svn | 76 git for-each-ref --format="%(objectname) %(refname:short)" refs/remotes/svn |
| 61 } | 77 } |
| 62 | 78 |
| 63 tag_revision() { | 79 tag_revision() { |
| 64 cut -d" " -f1 | 80 cut -d" " -f1 |
| 65 } | 81 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 106 merges_to_branch() { | 122 merges_to_branch() { |
| 107 git cherry -v svn/trunk svn/$1 | while read merge; do | 123 git cherry -v svn/trunk svn/$1 | while read merge; do |
| 108 h=$(echo $merge | cut -d" " -f2) | 124 h=$(echo $merge | cut -d" " -f2) |
| 109 svn=$(svn_rev $1 $h) | 125 svn=$(svn_rev $1 $h) |
| 110 merges=$(echo $merge | grep -o "r[0-9]\+") | 126 merges=$(echo $merge | grep -o "r[0-9]\+") |
| 111 rev=$(v8_rev $h) | 127 rev=$(v8_rev $h) |
| 112 echo $rev r$svn $merges | 128 echo $rev r$svn $merges |
| 113 done | 129 done |
| 114 } | 130 } |
| 115 | 131 |
| 132 url_for() { | |
| 133 first=$(svn_rev trunk $(v8_hash $(echo $1 | cut -d":" -f1))) | |
| 134 last=$(svn_rev trunk $(v8_hash $(echo $1 | cut -d":" -f2))) | |
| 135 num=$[ $last - $first] | |
| 136 echo "$BASE_URL?num=$num&start=$last" | |
| 137 } | |
| 138 | |
| 116 ########## Option parsing | 139 ########## Option parsing |
| 117 | 140 |
| 118 while getopts ":hi:v:m:p:" OPTION ; do | 141 while getopts ":hi:v:m:p:u:" OPTION ; do |
| 119 case $OPTION in | 142 case $OPTION in |
| 120 h) usage | 143 h) usage |
| 121 exit 0 | 144 exit 0 |
| 122 ;; | 145 ;; |
| 123 i) tag_version $OPTARG | 146 i) tag_version $OPTARG |
| 124 ;; | 147 ;; |
| 125 v) v8_rev $(svn_rev trunk r$OPTARG) | 148 v) v8_rev $(svn_rev trunk r$OPTARG) |
| 126 ;; | 149 ;; |
| 127 m) merges_to_branch $OPTARG | 150 m) merges_to_branch $OPTARG |
| 128 ;; | 151 ;; |
| 129 p) point_merges "$(tag_log $(v8_hash $OPTARG)^1)" | 152 p) echo $(point_merges "$(tag_log $(v8_hash $OPTARG)^1)") |
| 153 ;; | |
| 154 u) url_for $OPTARG | |
| 130 ;; | 155 ;; |
| 131 ?) echo "Illegal option: -$OPTARG" | 156 ?) echo "Illegal option: -$OPTARG" |
| 132 usage | 157 usage |
| 133 exit 1 | 158 exit 1 |
| 134 ;; | 159 ;; |
| 135 esac | 160 esac |
| 136 done | 161 done |
| OLD | NEW |