Chromium Code Reviews| Index: git-lkgr |
| =================================================================== |
| --- git-lkgr (revision 0) |
| +++ git-lkgr (revision 0) |
| @@ -0,0 +1,36 @@ |
| +#!/bin/bash |
| + |
| +svn_lkgr=`curl -s http://chromium-status.appspot.com/lkgr` |
| +if [ $? != 0 -o -z "$svn_lkgr" ]; then |
| + echo 'Could not get svn lkgr from chromium-status.appspot.com/lkgr' |
| + exit 1 |
| +fi |
| + |
| +git_lkgr=`git svn find-rev r${svn_lkgr}` |
| +if [ $? != 0 -o -z "$git_lkgr" ]; then |
| + echo 'Could not map svn revision ${svn_lkgr} to a git commit.' |
| + echo 'You may need to `git fetch`.' |
| + exit 1 |
| +fi |
| + |
| +set -o pipefail yes |
|
Jeffrey Yasskin
2012/09/22 09:01:30
Just "set -o pipefail".
|
| +closest_commit=`git rev-list --ancestry-path --grep='SVN changes up to revision [0-9]*' ${git_lkgr}..refs/remotes/origin/master | tail -1` |
| +if [ $? != 0 -o -z "$closest_commit" ]; then |
| + echo 'Could not find a blessed git commit (with accurate .DEPS.git and submodules) after lkgr' |
| + exit 1 |
| +fi |
| + |
| +closest_svn_commit=`git rev-list -n 1 ${closest_commit}^1` |
| +if [ $? != 0 -o -z "$closest_svn_commit" ]; then |
| + echo 'I am thoroughly confused. Please send a bug report to chrome-infrastructure-team.' |
| + exit 1 |
| +fi |
| + |
| +if [ "${closest_svn_commit}" = "${git_lkgr}" ]; then |
| + echo "${closest_commit}" |
| + exit 0 |
| +else |
| + echo "There is no master commit which corresponds exactly to lkgr." 1>&2 |
| + echo "The closest commit is ${closest_commit}." 1>&2 |
| + exit 1 |
| +fi |
| Property changes on: git-lkgr |
| ___________________________________________________________________ |
| Added: svn:executable |
| + * |