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

Commit 3534ec8

Browse files
jeisingerMrunal Kapade
authored and
Mrunal Kapade
committed
[Backport] Use the latest hash with a commit position as webkit version
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 [email protected],[email protected],[email protected] 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]
1 parent 15a9171 commit 3534ec8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

build/util/lastchange.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,18 @@ def FetchGitRevision(directory, hash_only):
100100
A VersionInfo object or None on error.
101101
"""
102102
hsh = ''
103-
proc = RunGitCommand(directory, ['rev-parse', 'HEAD'])
103+
git_args = ['log', '-1', '--format=%H']
104+
if hash_only:
105+
git_args.append('--grep=^Cr-Commit-Position:')
106+
proc = RunGitCommand(directory, git_args)
104107
if proc:
105108
output = proc.communicate()[0].strip()
106109
if proc.returncode == 0 and output:
107110
hsh = output
108111
if not hsh:
109112
return None
110113
pos = ''
111-
proc = RunGitCommand(directory, ['cat-file', 'commit', 'HEAD'])
114+
proc = RunGitCommand(directory, ['cat-file', 'commit', hsh])
112115
if proc:
113116
output = proc.communicate()[0]
114117
if proc.returncode == 0 and output:
@@ -264,8 +267,8 @@ def main(argv=None):
264267
help="In a Git-SVN repo, dig down to the last committed " +
265268
"SVN change (historic behaviour).")
266269
parser.add_option("--git-hash-only", action="store_true",
267-
help="In a Git repo with commit positions, only report " +
268-
"the hash.")
270+
help="In a Git repo with commit positions, report only " +
271+
"the hash of the latest commit with a position.")
269272
opts, args = parser.parse_args(argv[1:])
270273

271274
out_file = opts.output

0 commit comments

Comments
 (0)