build-scripts/showrev.sh
changeset 4419 5e7e1f1a4056
parent 3280 00cace2d9080
child 4464 fa77a6429698
equal deleted inserted replaced
4418:be1929ccaa3d 4419:5e7e1f1a4056
     1 #!/bin/sh
     1 #!/bin/sh
     2 #
     2 #
     3 # Print the current source revision, if available
     3 # Print the current source revision, if available
     4 
     4 
     5 srcdir=`dirname $0`/..
     5 # FIXME: this prints the tip, which isn't useful if you're on a different
       
     6 #  branch, or just not sync'd to the tip.
       
     7 hg tip --template 'hg-{rev}:{node|short}'
     6 
     8 
     7 if [ -d $srcdir/.svn ]; then
       
     8     cd $srcdir
       
     9     (svnversion -c 2>/dev/null || svnversion .) | \
       
    10         sed -e 's,\([0-9]*\)[A-Z]*,\1,' \
       
    11             -e 's,[0-9]*:\([0-9]*\)[A-Z]*,\1,'
       
    12 else
       
    13      cd $srcdir
       
    14      git svn info | grep Revision | awk '{ print $2 }'
       
    15 fi