To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Revision:

root / SCRIPTS / include.sh

History | View | Annotate | Download (487 Bytes)

1
#!/bin/bash
2

    
3
vcs_id() {
4
    dir="$1"
5
    ( cd "$dir" ;
6
      if [ -d .hg ]; then
7
	  tag=$(hg id -t -r 'parents(.)') # tag is always followed by tag-commit
8
	  if [ "$tag" != "" ]; then
9
	      echo "${tag#$dir-}" # strip dir- prefix from tag if present
10
	  else 
11
	      hg id | awk '{ print $1; }'
12
	  fi
13
      elif [ -d .git ]; then
14
	  git rev-parse --short HEAD
15
      elif [ -d .svn ]; then
16
	  svn info | grep ^Revision | awk '{ print $2; }'
17
      else
18
	  echo "unknown"
19
      fi
20
    )
21
}
22