mirror of
https://github.com/golang/go
synced 2024-11-24 07:40:17 -07:00
version.bash: cope with ancient Mercurial
R=adg CC=dpx, golang-dev https://golang.org/cl/593043
This commit is contained in:
parent
141821d512
commit
cf5ee36aa0
@ -10,10 +10,16 @@ if ! hg version > /dev/null 2>&1; then
|
||||
fi
|
||||
|
||||
# Get numerical revision
|
||||
VERSION="`hg identify -n`"
|
||||
VERSION=$(hg identify -n 2>/dev/null)
|
||||
if [ $? = 0 ]; then
|
||||
TAG=$(hg identify -t | sed 's!/release!!')
|
||||
else
|
||||
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'
|
||||
TAG=$(hg identify -t | sed 's!/release!!')
|
||||
if [[ "$TAG" != "tip" ]]; then
|
||||
VERSION="$VERSION $TAG"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user