Revision ad9b2a41

View differences:

version.sh
1 1
#!/bin/sh
2 2

  
3
# check for SVN revision number
4 3
revision=$(cd "$1" && cat snapshot_version 2> /dev/null)
5
test "$revision" || revision=$(cd "$1" && LC_ALL=C svn info 2> /dev/null | grep "Last Changed Rev" | cut -d' ' -f4)
6
test "$revision" || revision=$(cd "$1" && grep committed-rev .svn/entries 2>/dev/null | head -n 1 | cut -d '"' -f2)
7
test "$revision" || revision=$(cd "$1" && sed -n -e '/^dir$/{n
8
p
9
q
10
}' .svn/entries 2>/dev/null)
11 4
test "$revision" && revision=SVN-r$revision
12 5

  
13
# check for git svn revision number
14
if ! test "$revision"; then
15
    revision=$(cd "$1" && git svn find-rev HEAD 2> /dev/null)
16
    test "$revision" && revision=git-svn-r$revision
17
fi
18

  
19 6
# check for git short hash
20 7
if ! test "$revision"; then
21 8
    revision=$(cd "$1" && git describe --tags --match N 2> /dev/null)

Also available in: Unified diff