]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: new version for string for development branch
authorRuss Cox <rsc@golang.org>
Tue, 25 Sep 2012 01:35:20 +0000 (21:35 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 25 Sep 2012 01:35:20 +0000 (21:35 -0400)
Remove VERSION, which was forcing version to 'devel'.

Old:
$ go version
go version devel

New:
$ go version
go version devel +0a3866d6cc6b Mon Sep 24 20:08:05 2012 -0400

The date and time (and time zone) is that of the most recent commit,
not the time of the build itself. With some effort we could normalize
the zone, but I don't think it's worth the effort (more C coding,
since Mercurial is unhelpful).

R=r, dsymonds
CC=golang-dev
https://golang.org/cl/6569049

VERSION [deleted file]
src/cmd/api/goapi.go
src/cmd/dist/build.c

diff --git a/VERSION b/VERSION
deleted file mode 100644 (file)
index 626e97d..0000000
--- a/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-devel
\ No newline at end of file
index ad2c5770a054c15c35d449346233f8705e3d35ff..4d888edf169b320a6b8c993b1db0b1dcc6f136d8 100644 (file)
@@ -100,7 +100,7 @@ func setContexts() {
 func main() {
        flag.Parse()
 
-       if !strings.Contains(runtime.Version(), "weekly") && runtime.Version() != "devel" {
+       if !strings.Contains(runtime.Version(), "weekly") && !strings.Contains(runtime.Version(), "devel") {
                if *nextFile != "" {
                        fmt.Printf("Go version is %q, ignoring -next %s\n", runtime.Version(), *nextFile)
                        *nextFile = ""
index 9522dffb2b008f8c1878b2cf42ba24a9484a5dea..8c813006ecb121658f0040ad254dda345326b8b7 100644 (file)
@@ -207,7 +207,7 @@ findgoversion(void)
        chomp(&branch);
 
        // What are the tags along the current branch?
-       tag = "";
+       tag = "devel";
        rev = ".";
        run(&b, goroot, CheckExit, "hg", "log", "-b", bstr(&branch), "-r", ".:0", "--template", "{tags} + ", nil);
        splitfields(&tags, bstr(&b));
@@ -216,7 +216,9 @@ findgoversion(void)
                p = tags.p[i];
                if(streq(p, "+"))
                        nrev++;
-               if(hasprefix(p, "release.") || hasprefix(p, "weekly.") || hasprefix(p, "go")) {
+               // NOTE: Can reenable the /* */ code when we want to
+               // start reporting versions named 'weekly' again.
+               if(/*hasprefix(p, "weekly.") ||*/ hasprefix(p, "go")) {
                        tag = xstrdup(p);
                        // If this tag matches the current checkout
                        // exactly (no "+" yet), don't show extra
@@ -236,7 +238,7 @@ findgoversion(void)
        if(rev[0]) {
                // Tag is before the revision we're building.
                // Add extra information.
-               run(&bmore, goroot, CheckExit, "hg", "log", "--template", " +{node|short}", "-r", rev, nil);
+               run(&bmore, goroot, CheckExit, "hg", "log", "--template", " +{node|short} {date|date}", "-r", rev, nil);
                chomp(&bmore);
        }