[llvm] r180592 - Use 'git svn find-rev' in git-svnrevert instead of shell script fu.

Michael Gottesman mgottesman at apple.com
Thu Apr 25 20:27:39 PDT 2013


Author: mgottesman
Date: Thu Apr 25 22:27:39 2013
New Revision: 180592

URL: http://llvm.org/viewvc/llvm-project?rev=180592&view=rev
Log:
Use 'git svn find-rev' in git-svnrevert instead of shell script fu.

Thanks Chandler!

Modified:
    llvm/trunk/utils/git-svn/git-svnrevert

Modified: llvm/trunk/utils/git-svn/git-svnrevert
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/git-svn/git-svnrevert?rev=180592&r1=180591&r2=180592&view=diff
==============================================================================
--- llvm/trunk/utils/git-svn/git-svnrevert (original)
+++ llvm/trunk/utils/git-svn/git-svnrevert Thu Apr 25 22:27:39 2013
@@ -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
 





More information about the llvm-commits mailing list