summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorjochen <jochen@chromium.org>2015-09-24 08:52:09 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-24 15:54:26 +0000
commitfb61e3682fe7301373360fa851c7cb3dea9aec1f (patch)
tree71de6873adbd78f50ae231d68a99dfa529033d2f /build
parentb0f736298eb81321e70504d2ea111ebe681ecd80 (diff)
downloadchromium_src-fb61e3682fe7301373360fa851c7cb3dea9aec1f.zip
chromium_src-fb61e3682fe7301373360fa851c7cb3dea9aec1f.tar.gz
chromium_src-fb61e3682fe7301373360fa851c7cb3dea9aec1f.tar.bz2
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 R=pfeldman@chromium.org,mnaganov@chromium.org,dpranke@chromium.org Review URL: https://codereview.chromium.org/1361393002 Cr-Commit-Position: refs/heads/master@{#350565}
Diffstat (limited to 'build')
-rwxr-xr-xbuild/util/lastchange.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/build/util/lastchange.py b/build/util/lastchange.py
index ce1926a..c81e0bd 100755
--- a/build/util/lastchange.py
+++ b/build/util/lastchange.py
@@ -100,7 +100,10 @@ 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:
@@ -108,7 +111,7 @@ def FetchGitRevision(directory, hash_only):
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:
@@ -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