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

Delta Between Two Patch Sets: misc/dashboard/builder/hg.go

Issue 4172056: code review 4172056: gobuilder: add -package flag to build external packages (Closed)
Left Patch Set: diff -r c166ed517af1 https://go.googlecode.com/hg/ Created 14 years ago
Right Patch Set: diff -r 0309fd640319 https://go.googlecode.com/hg/ Created 14 years 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « misc/dashboard/builder/exec.go ('k') | misc/dashboard/builder/http.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
1 package main 5 package main
2 6
3 import ( 7 import (
4 "fmt" 8 "fmt"
5 "os" 9 "os"
6 "regexp" 10 "regexp"
7 "strconv" 11 "strconv"
8 "strings" 12 "strings"
9 ) 13 )
10 14
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 "--rev", rev, 56 "--rev", rev,
53 "--limit", "1", 57 "--limit", "1",
54 "--template", format, 58 "--template", format,
55 ) 59 )
56 if err != nil { 60 if err != nil {
57 return 61 return
58 } 62 }
59 return strings.Split(s, ">", 5), nil 63 return strings.Split(s, ">", 5), nil
60 } 64 }
61 65
62 var revisionRe = regexp.MustCompile("([0-9]+):[0-9a-f]+$") 66 var revisionRe = regexp.MustCompile(`([0-9]+):[0-9a-f]+$`)
r 2011/02/23 04:42:37 use `` for regexps, just on principle (unless you
63 67
64 // getTag fetches a Commit by finding the first hg tag that matches re. 68 // getTag fetches a Commit by finding the first hg tag that matches re.
65 func getTag(re *regexp.Regexp) (c Commit, tag string, err os.Error) { 69 func getTag(re *regexp.Regexp) (c Commit, tag string, err os.Error) {
66 o, _, err := runLog(nil, "", goroot, "hg", "tags") 70 o, _, err := runLog(nil, "", goroot, "hg", "tags")
67 for _, l := range strings.Split(o, "\n", -1) { 71 for _, l := range strings.Split(o, "\n", -1) {
68 tag = re.FindString(l) 72 tag = re.FindString(l)
69 if tag == "" { 73 if tag == "" {
70 continue 74 continue
71 } 75 }
72 s := revisionRe.FindStringSubmatch(l) 76 s := revisionRe.FindStringSubmatch(l)
73 if s == nil { 77 if s == nil {
74 err = os.NewError("couldn't find revision number") 78 err = os.NewError("couldn't find revision number")
75 return 79 return
76 } 80 }
77 c, err = getCommit(s[1]) 81 c, err = getCommit(s[1])
78 return 82 return
79 } 83 }
80 err = os.NewError("no matching tag found") 84 err = os.NewError("no matching tag found")
81 return 85 return
82 } 86 }
LEFTRIGHT

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