Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
[Backport] Use the latest hash with a commit position as webkit version
Browse files Browse the repository at this point in the history
This will guarantee that a development build with a not yet commit HEAD
will also get a valid devtools frontend from the servers

BUG=535268
R=pfeldman@chromium.org,mnaganov@chromium.org,dpranke@chromium.org

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

[necessary so that lastchange.py does not use the tip of the
 chromium-crosswalk tree when generating UPSTREAM.blink]
  • Loading branch information
jeisinger authored and Mrunal Kapade committed Nov 20, 2015
1 parent 15a9171 commit 3534ec8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions build/util/lastchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,18 @@ def FetchGitRevision(directory, hash_only):
A VersionInfo object or None on error.
"""
hsh = ''
proc = RunGitCommand(directory, ['rev-parse', 'HEAD'])
git_args = ['log', '-1', '--format=%H']
if hash_only:
git_args.append('--grep=^Cr-Commit-Position:')
proc = RunGitCommand(directory, git_args)
if proc:
output = proc.communicate()[0].strip()
if proc.returncode == 0 and output:
hsh = output
if not hsh:
return None
pos = ''
proc = RunGitCommand(directory, ['cat-file', 'commit', 'HEAD'])
proc = RunGitCommand(directory, ['cat-file', 'commit', hsh])
if proc:
output = proc.communicate()[0]
if proc.returncode == 0 and output:
Expand Down Expand Up @@ -264,8 +267,8 @@ def main(argv=None):
help="In a Git-SVN repo, dig down to the last committed " +
"SVN change (historic behaviour).")
parser.add_option("--git-hash-only", action="store_true",
help="In a Git repo with commit positions, only report " +
"the hash.")
help="In a Git repo with commit positions, report only " +
"the hash of the latest commit with a position.")
opts, args = parser.parse_args(argv[1:])

out_file = opts.output
Expand Down

0 comments on commit 3534ec8

Please sign in to comment.