aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/git-svn/git-svnrevert
diff options
context:
space:
mode:
authorMichael Gottesman <mgottesman@apple.com>2013-04-26 03:27:39 +0000
committerMichael Gottesman <mgottesman@apple.com>2013-04-26 03:27:39 +0000
commit68be5200b8be74c89137d9ad1146f5292d87a83c (patch)
tree39b2ea0eeff79aeba2d4396ee248666cb5a45c80 /llvm/utils/git-svn/git-svnrevert
parent327be3cc20e608ccd94dcc43dd9f8a6f66ad3adf (diff)
downloadllvm-68be5200b8be74c89137d9ad1146f5292d87a83c.zip
llvm-68be5200b8be74c89137d9ad1146f5292d87a83c.tar.gz
llvm-68be5200b8be74c89137d9ad1146f5292d87a83c.tar.bz2
Use 'git svn find-rev' in git-svnrevert instead of shell script fu.
Thanks Chandler! llvm-svn: 180592
Diffstat (limited to 'llvm/utils/git-svn/git-svnrevert')
-rwxr-xr-xllvm/utils/git-svn/git-svnrevert7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/utils/git-svn/git-svnrevert b/llvm/utils/git-svn/git-svnrevert
index de4ff1c..06a9c44 100755
--- a/llvm/utils/git-svn/git-svnrevert
+++ b/llvm/utils/git-svn/git-svnrevert
@@ -14,10 +14,9 @@ fi
COMMIT=$1
-SVN_REVISION=$(git log -1 $COMMIT | grep git-svn-id | tr -s "@" " " | cut -f 4 -d " ")
-
-if [ -z "$SVN_REVISION" ]; then
- echo "Error! Given commit is not a git-svn revision!"
+SVN_REVISION=$(git svn find-rev "$COMMIT")
+if [ $? -ne 0 ]; then
+ echo "Error! Could not find an svn revision for commit $COMMIT!"
exit 1
fi