diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-02-18 09:50:58 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-02-18 09:50:58 +0100 |
commit | c072558b90f1bbedc2022b0f30c8b1ac4712538e (patch) | |
tree | 67767591619e4bd8111fb05fac185cde94fb7378 /src/version.bash | |
parent | 5859517b767c99749a45651c15d4bae5520ebae8 (diff) | |
download | golang-upstream/2011.02.15.tar.gz |
Imported Upstream version 2011.02.15upstream/2011.02.15
Diffstat (limited to 'src/version.bash')
-rwxr-xr-x | src/version.bash | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/version.bash b/src/version.bash index 2d29825ff..0e6483150 100755 --- a/src/version.bash +++ b/src/version.bash @@ -11,17 +11,16 @@ fi # Get numerical revision VERSION=$(hg identify -n 2>/dev/null) -if [ $? = 0 ]; then - TAG=$(hg identify -t | sed 's!/release!!') -else +if [ $? != 0 ]; then OLD=$(hg identify | sed 1q) VERSION=$(echo $OLD | awk '{print $1}') - TAG=$(echo $OLD | awk '{print $2}' | sed 's!/release!!') fi -# Append tag if not 'tip' -if [[ "$TAG" != "tip" ]]; then - VERSION="$VERSION $TAG" +# Find most recent known release tag. +TAG=$(hg tags | awk '$1~/^release\./ {print $1}' | sed -n 1p) + +if [ "$TAG" != "" ]; then + VERSION="$TAG $VERSION" fi echo $VERSION |