Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(130)

Delta Between Two Patch Sets: misc/dashboard/app/build/build.go

Issue 11936045: code review 11936045: misc/dashboard: fix typo in comment (Closed)
Left Patch Set: Created 11 years, 8 months ago
Right Patch Set: diff -r bb1a2debd0fa https://dvyukov%40google.com@code.google.com/p/go/ Created 11 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // Copyright 2011 The Go Authors. All rights reserved. 1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package build 5 package build
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "compress/gzip" 9 "compress/gzip"
10 "crypto/sha1" 10 "crypto/sha1"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 if c.ParentHash != "" && !validHash(c.ParentHash) { // empty is OK 116 if c.ParentHash != "" && !validHash(c.ParentHash) { // empty is OK
117 return errors.New("invalid ParentHash") 117 return errors.New("invalid ParentHash")
118 } 118 }
119 return nil 119 return nil
120 } 120 }
121 121
122 // each result line is approx 105 bytes. This constant is a tradeoff between 122 // each result line is approx 105 bytes. This constant is a tradeoff between
123 // build history and the AppEngine datastore limit of 1mb. 123 // build history and the AppEngine datastore limit of 1mb.
124 const maxResults = 1000 124 const maxResults = 1000
125 125
126 // AddResult adds the denormalized Reuslt data to the Commit's Result field. 126 // AddResult adds the denormalized Result data to the Commit's Result field.
127 // It must be called from inside a datastore transaction. 127 // It must be called from inside a datastore transaction.
128 func (com *Commit) AddResult(c appengine.Context, r *Result) error { 128 func (com *Commit) AddResult(c appengine.Context, r *Result) error {
129 if err := datastore.Get(c, com.Key(c), com); err != nil { 129 if err := datastore.Get(c, com.Key(c), com); err != nil {
130 return fmt.Errorf("getting Commit: %v", err) 130 return fmt.Errorf("getting Commit: %v", err)
131 } 131 }
132 com.ResultData = trim(append(com.ResultData, r.Data()), maxResults) 132 com.ResultData = trim(append(com.ResultData, r.Data()), maxResults)
133 if _, err := datastore.Put(c, com.Key(c), com); err != nil { 133 if _, err := datastore.Put(c, com.Key(c), com); err != nil {
134 return fmt.Errorf("putting Commit: %v", err) 134 return fmt.Errorf("putting Commit: %v", err)
135 } 135 }
136 return nil 136 return nil
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 break 321 break
322 } else if err != nil { 322 } else if err != nil {
323 return nil, err 323 return nil, err
324 } 324 }
325 if pkg.Path != "" { 325 if pkg.Path != "" {
326 pkgs = append(pkgs, pkg) 326 pkgs = append(pkgs, pkg)
327 } 327 }
328 } 328 }
329 return pkgs, nil 329 return pkgs, nil
330 } 330 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b