]> Cypherpunks repositories - gostls13.git/commitdiff
dashboard: delay hg pull until needed
authorRuss Cox <rsc@golang.org>
Fri, 13 May 2011 16:14:31 +0000 (12:14 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 13 May 2011 16:14:31 +0000 (12:14 -0400)
R=adg
CC=golang-dev
https://golang.org/cl/4526052

misc/dashboard/builder/main.go

index c8583f79d9ac3d8fc7a4434b3c17fe4e549d074c..86cc0c1ca9398f8849aafbaecd7222e6ca9b6568 100644 (file)
@@ -127,12 +127,6 @@ func main() {
        // go continuous build mode (default)
        // check for new commits and build them
        for {
-               err := run(nil, goroot, "hg", "pull", "-u")
-               if err != nil {
-                       log.Println("hg pull failed:", err)
-                       time.Sleep(waitInterval)
-                       continue
-               }
                built := false
                t := time.Nanoseconds()
                if *parallel {
@@ -247,6 +241,15 @@ func (b *Builder) build() bool {
        if hash == "" {
                return false
        }
+       // Look for hash locally before running hg pull.
+       
+       if _, err := fullHash(hash[:12]); err != nil {
+               // Don't have hash, so run hg pull.
+               if err := run(nil, goroot, "hg", "pull"); err != nil {
+                       log.Println("hg pull failed:", err)
+                       return false
+               }
+       }
        err = b.buildHash(hash)
        if err != nil {
                log.Println(err)