summaryrefslogtreecommitdiff
path: root/utils
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
commit276b8549ee177ee584699638dd17eb358e25ace1 (patch)
treeb13b402338cc9ea508985b8b1f9a55e9c76349ae /utils
parentd15d29e7c8290ff27457d5244360f894d806b083 (diff)
downloadllvm-276b8549ee177ee584699638dd17eb358e25ace1.tar.gz
llvm-276b8549ee177ee584699638dd17eb358e25ace1.tar.bz2
llvm-276b8549ee177ee584699638dd17eb358e25ace1.tar.xz
Use 'git svn find-rev' in git-svnrevert instead of shell script fu.
Thanks Chandler! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180592 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rwxr-xr-xutils/git-svn/git-svnrevert7
1 files changed, 3 insertions, 4 deletions
diff --git a/utils/git-svn/git-svnrevert b/utils/git-svn/git-svnrevert
index de4ff1cd46..06a9c44091 100755
--- a/utils/git-svn/git-svnrevert
+++ b/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