]> Cypherpunks repositories - gostls13.git/commitdiff
build: make version.bash aware of branches
authorAndrew Gerrand <adg@golang.org>
Thu, 30 Jun 2011 05:39:00 +0000 (15:39 +1000)
committerAndrew Gerrand <adg@golang.org>
Thu, 30 Jun 2011 05:39:00 +0000 (15:39 +1000)
Fixes #2026.

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/4645074

src/version.bash

index b45f15a6c4f274297ed46c09e45b23927797cd92..ce5a9969a2e2a71932878ef6cebfa1367603efa2 100755 (executable)
@@ -16,8 +16,15 @@ if [ $? != 0 ]; then
        VERSION=$(echo $OLD | awk '{print $1}')
 fi
 
-# Find most recent known release tag.
+# Get branch type
+BRANCH=release
+if [ "$(hg identify -b 2>/dev/null)" == "default" ]; then
+       BRANCH=weekly
+fi
+
+# Find most recent known release or weekly tag.
 TAG=$(hg tags |
+       grep $BRANCH |
        sed 's/:.*//' |
        sort -rn -k2 |
        awk -v ver=$VERSION '$2 <= ver && $1~/^(release|weekly)\./ {print $1}' |