mirror of
https://github.com/golang/go
synced 2024-11-26 06:57:56 -07:00
08ceb870f2
.hgtags, release.html: tag current weekly as release.r56 R=r, rsc CC=golang-dev https://golang.org/cl/4281041
31 lines
671 B
Bash
Executable File
31 lines
671 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Copyright 2010 The Go Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style
|
|
# license that can be found in the LICENSE file.
|
|
|
|
# Check that we can use 'hg'
|
|
if ! hg version > /dev/null 2>&1; then
|
|
echo 'hg not installed' 1>&2
|
|
exit 2
|
|
fi
|
|
|
|
# Get numerical revision
|
|
VERSION=$(hg identify -n 2>/dev/null)
|
|
if [ $? != 0 ]; then
|
|
OLD=$(hg identify | sed 1q)
|
|
VERSION=$(echo $OLD | awk '{print $1}')
|
|
fi
|
|
|
|
# Find most recent known release tag.
|
|
TAG=$(hg tags |
|
|
sort -rn -k2 |
|
|
awk -vver=$VERSION '$2 <= ver && $1~/^(release|weekly)\./ {print $1}' |
|
|
sed -n 1p)
|
|
|
|
if [ "$TAG" != "" ]; then
|
|
VERSION="$TAG $VERSION"
|
|
fi
|
|
|
|
echo $VERSION
|
|
|