| OLD | NEW |
| 1 package repo_manager | 1 package repo_manager |
| 2 | 2 |
| 3 import ( | 3 import ( |
| 4 "fmt" | 4 "fmt" |
| 5 "os" | 5 "os" |
| 6 "path" | 6 "path" |
| 7 "regexp" | 7 "regexp" |
| 8 "strconv" | 8 "strconv" |
| 9 "strings" | 9 "strings" |
| 10 "sync" | 10 "sync" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 util.LogErr(r.cleanChromium()) | 278 util.LogErr(r.cleanChromium()) |
| 279 }() | 279 }() |
| 280 | 280 |
| 281 // Create the roll CL. | 281 // Create the roll CL. |
| 282 if _, err := exec.RunCwd(r.chromiumDir, "git", "config", "user.name", au
toroll.ROLL_AUTHOR); err != nil { | 282 if _, err := exec.RunCwd(r.chromiumDir, "git", "config", "user.name", au
toroll.ROLL_AUTHOR); err != nil { |
| 283 return 0, err | 283 return 0, err |
| 284 } | 284 } |
| 285 if _, err := exec.RunCwd(r.chromiumDir, "git", "config", "user.email", a
utoroll.ROLL_AUTHOR); err != nil { | 285 if _, err := exec.RunCwd(r.chromiumDir, "git", "config", "user.email", a
utoroll.ROLL_AUTHOR); err != nil { |
| 286 return 0, err | 286 return 0, err |
| 287 } | 287 } |
| 288 |
| 289 // Find Chromium bugs. |
| 290 bugs := []string{} |
| 291 cr := r.childRepo |
| 292 commits, err := cr.RevList(fmt.Sprintf("%s..%s", r.lastRollRev, r.childH
ead)) |
| 293 if err != nil { |
| 294 return 0, fmt.Errorf("Failed to list revisions: %s", err) |
| 295 } |
| 296 for _, c := range commits { |
| 297 d, err := cr.Details(c, false) |
| 298 if err != nil { |
| 299 return 0, fmt.Errorf("Failed to obtain commit details: %
s", err) |
| 300 } |
| 301 b := util.BugsFromCommitMsg(d.Body) |
| 302 for _, bug := range b[util.PROJECT_CHROMIUM] { |
| 303 bugs = append(bugs, bug) |
| 304 } |
| 305 } |
| 306 |
| 307 args := []string{r.childPath, r.childHead} |
| 308 for _, bug := range bugs { |
| 309 args = append(args, "--bug", bug) |
| 310 } |
| 288 if _, err := exec.RunCommand(&exec.Command{ | 311 if _, err := exec.RunCommand(&exec.Command{ |
| 289 Dir: r.chromiumDir, | 312 Dir: r.chromiumDir, |
| 290 Env: []string{fmt.Sprintf("PATH=%s:%s", r.depot_tools, os.Geten
v("PATH"))}, | 313 Env: []string{fmt.Sprintf("PATH=%s:%s", r.depot_tools, os.Geten
v("PATH"))}, |
| 291 Name: r.rollDep, | 314 Name: r.rollDep, |
| 292 Args: []string{r.childPath, r.childHead}, | 315 Args: []string{r.childPath, r.childHead}, |
| 293 }); err != nil { | 316 }); err != nil { |
| 294 return 0, err | 317 return 0, err |
| 295 } | 318 } |
| 296 // Build the commit message, starting with the message provided by roll-
dep. | 319 // Build the commit message, starting with the message provided by roll-
dep. |
| 297 commitMsg, err := exec.RunCwd(r.chromiumDir, "git", "log", "-n1", "--for
mat=%B", "HEAD") | 320 commitMsg, err := exec.RunCwd(r.chromiumDir, "git", "log", "-n1", "--for
mat=%B", "HEAD") |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 issues := ISSUE_CREATED_REGEX.FindStringSubmatch(uploadOutput) | 352 issues := ISSUE_CREATED_REGEX.FindStringSubmatch(uploadOutput) |
| 330 if len(issues) != 2 { | 353 if len(issues) != 2 { |
| 331 return 0, fmt.Errorf("Failed to find newly-uploaded issue number
!") | 354 return 0, fmt.Errorf("Failed to find newly-uploaded issue number
!") |
| 332 } | 355 } |
| 333 return strconv.ParseInt(issues[1], 10, 64) | 356 return strconv.ParseInt(issues[1], 10, 64) |
| 334 } | 357 } |
| 335 | 358 |
| 336 func (r *repoManager) User() string { | 359 func (r *repoManager) User() string { |
| 337 return r.user | 360 return r.user |
| 338 } | 361 } |
| OLD | NEW |