aboutsummaryrefslogtreecommitdiff
path: root/0.4.0/misc/svn-version-filter.bash
blob: 38a36b74db9b178954c33ba60e2979f9a0cc8ca7 (plain)
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
#!/usr/bin/env bash

# For Doxygen. See:
# http://www.stack.nl/~dimitri/doxygen/config.html#cfg_file_version_filter

source ${0/.bash/-data.bash}

case $1 in
    *.svn*)
        echo $VERSION
        ;;

    *)
        case "$(basename $1 )" in
            *.cc|*.hh|*.hh.in)
                if type svn &>/dev/null ; then
                    echo -n "svn "
                    svn stat -v $1 | sed -n 's/^[ A-Z?\*|!]\{1,15\}/r/;s/ \{1,15\}/\/r/;s/ .*//p'
                else
                    echo $VERSION
                fi
                ;;

            *)
                echo $VERSION
                ;;
        esac
        ;;
esac