summaryrefslogtreecommitdiff
path: root/utils/git-svn
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2015-05-16 10:23:48 +0000
committerRenato Golin <renato.golin@linaro.org>2015-05-16 10:23:48 +0000
commit39dd163cdb3337be43ab8501fa03770177c6ea09 (patch)
treed9a7acf7b664637445f7f4f54f35914a34d1b74a /utils/git-svn
parentd43901cbb174ecf6579a85a1522e275d683339f0 (diff)
Improve check on git-svnrevert, better error message
When the commit is not in the tree at all, find-rev returns 0 and prints an empty string. We need to catch that problem too, when trying to revert. Adding a list of possible problems, so that you can easily and quickly correct without having to edit the script again. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237516 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/git-svn')
-rwxr-xr-xutils/git-svn/git-svnrevert7
1 files changed, 6 insertions, 1 deletions
diff --git a/utils/git-svn/git-svnrevert b/utils/git-svn/git-svnrevert
index f15e7abfb3f..4185ee7ae87 100755
--- a/utils/git-svn/git-svnrevert
+++ b/utils/git-svn/git-svnrevert
@@ -14,8 +14,13 @@ fi
COMMIT=$1
OTHER=$(git svn find-rev "$COMMIT")
-if [ $? -ne 0 ]; then
+if [ $? -ne 0 ] || [ "$OTHER" = "" ]; then
echo "Error! Could not find an svn/git revision for commit $COMMIT!"
+ echo
+ echo "Possible problems are:"
+ echo " * Your revision number ($COMMIT) is wrong"
+ echo " * This tree is not up to date (before that commit)"
+ echo " * This commit in in another three (llvm, clang, compiler-rt, etc)"
exit 1
fi