Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3107)

Unified Diff: build/util/lastchange.py

Issue 1361393002: Use the latest hash with a commit position as webkit version (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/util/lastchange.py
diff --git a/build/util/lastchange.py b/build/util/lastchange.py
index ce1926afc4d5bd37141624af079a4e36dcd1036b..c81e0bd52ecd5dd4a63abc3b139a5de1cc525beb 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698