4 revision
=$
(svn info
2>&1|
grep Revision|
sed 's/Revision: //')
5 stat
=$
(svn status
2>&1|
grep '^M')
7 # if that fails, try git-svn
8 if [ -z "$revision" ]; then
9 revision
=$
(git svn info
2>&1|
grep Revision|
sed 's/Revision: //')
10 stat
=$
(git status
2>&1|
grep 'modified: ')
11 # ...and also check if there are un-dcommited changesets
12 stat
=$stat$
(git
diff --stat HEAD git-svn
);
15 # if that fails, give up
16 if [ -z "$revision" ]; then
17 $revision="No SVN or git-svn working copy!"
19 if [ -n "$stat" ]; then
20 status
=" with local changes"
26 echo '// This file is created automatically, your changes will be lost.' > svnrevision.h
27 echo '#define SVNREVISION "r'$revision$status'"' >> svnrevision.h
This page took 0.052365 seconds and 5 git commands to generate.