2
# Copyright 2010 The Go Authors. All rights reserved.
3
# Use of this source code is governed by a BSD-style
4
# license that can be found in the LICENSE file.
6
# Check that we can use 'hg'
7
if ! hg version > /dev/null 2>&1; then
8
echo 'hg not installed' 1>&2
12
# Get numerical revision
13
VERSION=$(hg identify -n 2>/dev/null)
15
OLD=$(hg identify | sed 1q)
16
VERSION=$(echo $OLD | awk '{print $1}')
21
if [ "$(hg identify -b 2>/dev/null)" == "default" ]; then
25
# Find most recent known release or weekly tag.
30
awk -v ver=$VERSION '$2 <= ver && $1~/^(release|weekly)\./ {print $1}' |
33
if [ "$TAG" != "" ]; then
34
VERSION="$TAG $VERSION"