always update svnrevision.h, also work with git svn
authorsvnhieber <svnhieber@f8795833-4959-0410-8ae9-8bcb0cfab428>
Thu, 2 Dec 2010 18:04:24 +0000 (18:04 +0000)
committersvnhieber <svnhieber@f8795833-4959-0410-8ae9-8bcb0cfab428>
Thu, 2 Dec 2010 18:04:24 +0000 (18:04 +0000)
git-svn-id: https://svn.itm.uni-luebeck.de/wisebed/wiselib/trunk/pc_apps/roomba_tests@3676 f8795833-4959-0410-8ae9-8bcb0cfab428

Makefile
svnrevision.sh

index 63e8b19..60ffab0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -23,4 +23,5 @@ roomba_test: main.cc svnrevision.h
 battery_test: battery_test.cc
        $(CXX) $(CXXFLAGS) $< -o $@
 
+.PHONY: svnrevision.h
 # vim: noexpandtab :
index 67b03a2..072d714 100755 (executable)
@@ -1,8 +1,16 @@
 #!/bin/bash
+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;
+fi;
 
-revision=$(svn info|grep Revision|sed 's/Revision: //')
-
-if [ -n "$(svn status|grep '^M')" ]; then
+if [ -n "$stat" ]; then
   status=" with local changes"
 else
   status=""
This page took 0.045957 seconds and 4 git commands to generate.