Compute all version numbers using cef_version.py (see issue #2596)

The version format can now be controlled by setting the CEF_OLD_VERSION_FORMAT
environment variable. The old format is currently the default.
This commit is contained in:
Marshall Greenblatt
2019-03-14 17:37:47 -04:00
parent a76f40eb83
commit 2a40650926
14 changed files with 361 additions and 122 deletions

View File

@ -27,6 +27,27 @@ def get_hash(path='.', branch='HEAD'):
return 'Unknown'
def get_branch_name(path='.', branch='HEAD'):
""" Returns the branch name for the specified branch/tag/hash. """
# Returns the branch name if not in detached HEAD state, else an empty string
# or "HEAD".
cmd = "%s rev-parse --abbrev-ref %s" % (git_exe, branch)
result = exec_cmd(cmd, path)
if result['out'] != '':
name = result['out'].strip()
if len(name) > 0 and name != 'HEAD':
return name
# Returns a value like "(HEAD, origin/3729, 3729)".
# Ubuntu 14.04 uses Git version 1.9.1 which does not support %D (which
# provides the same output but without the parentheses).
cmd = "%s log -n 1 --pretty=%%d %s" % (git_exe, branch)
result = exec_cmd(cmd, path)
if result['out'] != '':
return result['out'].strip()[1:-1].split(', ')[-1]
return 'Unknown'
def get_url(path='.'):
""" Returns the origin url for the specified path. """
cmd = "%s config --get remote.origin.url" % git_exe
@ -63,6 +84,21 @@ def get_changed_files(path, hash):
return []
def get_branch_hashes(path='.', branch='HEAD', ref='origin/master'):
""" Returns an ordered list of hashes for commits that have been applied since
branching from ref. """
cmd = "%s cherry %s %s" % (git_exe, ref, branch)
result = exec_cmd(cmd, path)
if result['out'] != '':
hashes = result['out']
if sys.platform == 'win32':
# Convert to Unix line endings.
hashes = hashes.replace('\r\n', '\n')
# Remove the "+ " or "- " prefix.
return [line[2:] for line in hashes.strip().split('\n')]
return []
def write_indented_output(output):
""" Apply a fixed amount of intent to lines before printing. """
if output == '':