git-svn-id: https://svn.itm.uni-luebeck.de/wisebed/wiselib/trunk/pc_apps/roomba_tests@4090
f8795833-4959-0410-8ae9-
8bcb0cfab428
-if [ -d .svn ]; then
- revision=$(svn info|grep Revision|sed 's/Revision: //')
- stat=$(svn status|grep '^M')
-elif [ -d .git/svn ]; then
- revision=$(git svn info|grep Revision|sed 's/Revision: //')
- stat=$(git status|grep 'modified: ')
-else
- echo No SVN working copy!
- exit 1;
+
+# try SVN
+revision=$(svn info 2>&1|grep Revision|sed 's/Revision: //')
+stat=$(svn status 2>&1|grep '^M')
+
+# if that fails, try git-svn
+if [ -z "$revision" ]; then
+ revision=$(git svn info 2>&1|grep Revision|sed 's/Revision: //')
+ stat=$(git status 2>&1|grep 'modified: ');
-if [ -n "$stat" ]; then
- status=" with local changes"
+# if that fails, give up
+if [ -z "$revision" ]; then
+ $revision="No SVN or git-svn working copy!"
+ if [ -n "$stat" ]; then
+ status=" with local changes"
+ else
+ status=""
+ fi;
fi;
echo '// This file is created automatically, your changes will be lost.' > svnrevision.h
fi;
echo '// This file is created automatically, your changes will be lost.' > svnrevision.h