diff options
author | Renato Golin <renato.golin@linaro.org> | 2015-05-16 10:23:48 +0000 |
---|---|---|
committer | Renato Golin <renato.golin@linaro.org> | 2015-05-16 10:23:48 +0000 |
commit | 6fd0cb584a1182d1fad21630381da6b0103259cd (patch) | |
tree | fbd391c5a7e50eabb124bf9962709ee87f09a6a1 /llvm/utils/git-svn/git-svnrevert | |
parent | 41b94d9bfcbeb1910e5561a8f70d400df2e17f9c (diff) | |
download | llvm-6fd0cb584a1182d1fad21630381da6b0103259cd.zip llvm-6fd0cb584a1182d1fad21630381da6b0103259cd.tar.gz llvm-6fd0cb584a1182d1fad21630381da6b0103259cd.tar.bz2 |
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.
llvm-svn: 237516
Diffstat (limited to 'llvm/utils/git-svn/git-svnrevert')
-rwxr-xr-x | llvm/utils/git-svn/git-svnrevert | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/utils/git-svn/git-svnrevert b/llvm/utils/git-svn/git-svnrevert index f15e7ab..4185ee7 100755 --- a/llvm/utils/git-svn/git-svnrevert +++ b/llvm/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 |