Commit 740c0043 authored by agable's avatar agable Committed by Commit bot

Lengthen lastchange VERSION string to show full hash and commit position.

Now that the DMServer has been fixed to accept 'agent' strings longer than
64 characters (http://crbug.com/406948), we can re-lengthen the string
produced by lastchange.py to include both the full git hash and the
Cr-Commit-Position.

R=joaodasilva@chromium.org, scottmg@chromium.org
BUG=406783

Review URL: https://codereview.chromium.org/527103004

Cr-Commit-Position: refs/heads/master@{#292963}
parent fe2ae5fb
......@@ -99,8 +99,6 @@ def FetchGitRevision(directory):
Returns:
A VersionInfo object or None on error.
"""
# TODO(agable): Re-add the commit position after the lastchange value can
# accept strings longer than 64 characters. See crbug.com/406783.
hsh = ''
proc = RunGitCommand(directory, ['rev-parse', 'HEAD'])
if proc:
......@@ -109,9 +107,17 @@ def FetchGitRevision(directory):
hsh = output
if not hsh:
return None
# TODO(agable): Figure out a way to use the full hash instead of just a
# 12-character short hash. See crbug.com/406783.
return VersionInfo('git', hsh[:12])
pos = ''
proc = RunGitCommand(directory, ['show', '-s', '--format=%B', 'HEAD'])
if proc:
output = proc.communicate()[0]
if proc.returncode == 0 and output:
for line in reversed(output.splitlines()):
if line.startswith('Cr-Commit-Position:'):
pos = line.rsplit()[-1].strip()
if not pos:
return VersionInfo('git', hsh)
return VersionInfo('git', '%s-%s' % (hsh, pos))
def FetchGitSVNURLAndRevision(directory, svn_url_regex):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment