From cf5ee36aa0c50ab13b6acb485a7d058aadbf184f Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 16 Mar 2010 18:45:06 -0700 Subject: [PATCH] version.bash: cope with ancient Mercurial R=adg CC=dpx, golang-dev https://golang.org/cl/593043 --- src/version.bash | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/version.bash b/src/version.bash index c2a70ac1f7..2d29825ff9 100755 --- a/src/version.bash +++ b/src/version.bash @@ -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 -- 2.50.0