Returns the closest master position for the specified Chromium commit.
(commit)
| 504 | |
| 505 | |
| 506 | def get_chromium_master_position(commit): |
| 507 | """ Returns the closest master position for the specified Chromium commit. """ |
| 508 | # Using -2 because a "Publish DEPS" commit which does not have a master |
| 509 | # position may be first. |
| 510 | cmd = "%s log -2 %s" % (git_exe, commit) |
| 511 | result = exec_cmd(cmd, chromium_src_dir) |
| 512 | if result['out'] != '': |
| 513 | match = re.search(r'refs/heads/master@{#([\d]+)}', result['out']) |
| 514 | assert match != None, 'Failed to find position' |
| 515 | return int(match.groups()[0]) |
| 516 | return None |
| 517 | |
| 518 | |
| 519 | def get_chromium_master_commit(position): |
no test coverage detected