MCPcopy Create free account
hub / github.com/cztomczak/cefpython / get_chromium_master_position

Function get_chromium_master_position

tools/automate-git.py:506–516  ·  view source on GitHub ↗

Returns the closest master position for the specified Chromium commit.

(commit)

Source from the content-addressed store, hash-verified

504
505
506def 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
519def get_chromium_master_commit(position):

Callers 2

log_chromium_changesFunction · 0.85

Calls 1

exec_cmdFunction · 0.85

Tested by

no test coverage detected