From 68be5200b8be74c89137d9ad1146f5292d87a83c Mon Sep 17 00:00:00 2001 From: Michael Gottesman Date: Fri, 26 Apr 2013 03:27:39 +0000 Subject: Use 'git svn find-rev' in git-svnrevert instead of shell script fu. Thanks Chandler! llvm-svn: 180592 --- llvm/utils/git-svn/git-svnrevert | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'llvm/utils/git-svn/git-svnrevert') 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 -- cgit v1.1