forked from neuronsimulator/nrn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
svn2nrn_h.sh
executable file
·50 lines (47 loc) · 1.09 KB
/
svn2nrn_h.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
a=$1
if test "$a" = "" ; then
a=.
fi
b=0
c=unknown
d=""
last=0
if svnversion $a > /dev/null && test -d $a/.svn ; then
b=`svnversion $a`
c="`svn info $a | sed -n '
/^URL:/s/.*\///p
' | sed 's/%20/ /'`"
d="`svn info $a | sed -n '
/^Last Changed Date:/s/[^:]*: \([^ ]*\).*/\1/p
'`"
last="`svn info $a | sed -n '
/^Last Changed Rev:/s/[^:]*: \([0-9]*\).*/\1/p
'`"
httpurl=$a
if svn info $a | grep -q 'URL.*svn+ssh:' ; then
httpurl="`svn info $a | sed -n '
/^URL:/{
s/^URL.*svn+ssh:/http:/
s/hines@//
s/\/home\/svnroot\//\/svn\//p
}
'`"
fi
if test "$c" = "trunk" ; then
c=""
fi
tno=`svn log -v -q --stop-on-copy $httpurl | grep '^r' | wc -l | sed 's/[ ]*//'`
echo "#define SVN_DATE \"$d\""
echo "#define SVN_BRANCH \"$c\""
echo "#define SVN_CHANGESET \"($b)\""
echo "#define SVN_TREE_CHANGE \"$tno\""
echo "#define SVN_BASE_CHANGESET \"$last\""
else
echo "#define SVN_DATE \"1999-12-31\""
echo "#define SVN_BRANCH \"\""
echo "#define SVN_CHANGESET \"($b)\""
echo "#define SVN_TREE_CHANGE \"0\""
echo "#define SVN_BASE_CHANGESET \"0\""
exit 1
fi