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

Unified Diff: native_client_sdk/src/build_tools/build_version.py

Issue 2842513002: Update nacl SDK code to match recent changes to lastchange.py (Closed)
Patch Set: . Created 3 years, 8 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 | native_client_sdk/src/build_tools/tests/build_version_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/build_tools/build_version.py
diff --git a/native_client_sdk/src/build_tools/build_version.py b/native_client_sdk/src/build_tools/build_version.py
index 014b86e9927814fdb282cbbcdb9441ad29f51cf2..72fefdcdfa6a1821a20ca16c92a5eddc4b00de32 100644
--- a/native_client_sdk/src/build_tools/build_version.py
+++ b/native_client_sdk/src/build_tools/build_version.py
@@ -28,11 +28,10 @@ def ChromeVersion():
Returns:
Chrome version string or trunk + svn rev.
'''
- info = FetchGitCommitPosition()
- if info.url == 'git':
- _, ref, revision = ParseCommitPosition(info.revision)
- if ref == 'refs/heads/master':
- return 'trunk.%s' % revision
+ info = FetchCommitPosition()
+ _, ref, revision = ParseCommitPosition(info.revision)
+ if ref == 'refs/heads/master':
+ return 'trunk.%s' % revision
return ChromeVersionNoTrunk()
@@ -67,7 +66,7 @@ def ChromeRevision():
Returns:
The Chrome revision as a string. e.g. "12345"
'''
- version = FetchGitCommitPosition()
+ version = FetchCommitPosition()
return ParseCommitPosition(version.revision)[2]
@@ -78,7 +77,7 @@ def ChromeCommitPosition():
A value like:
0178d4831bd36b5fb9ff477f03dc43b11626a6dc-refs/heads/master@{#292238}
'''
- return FetchGitCommitPosition().revision
+ return FetchCommitPosition().revision
def NaClRevision():
@@ -88,10 +87,10 @@ def NaClRevision():
The NaCl revision as a string. e.g. "12345"
'''
nacl_dir = os.path.join(SRC_DIR, 'native_client')
- return lastchange.FetchVersionInfo(None, nacl_dir, 'native_client').revision
+ return lastchange.FetchVersionInfo(nacl_dir).revision
-def FetchGitCommitPosition(directory=None):
+def FetchCommitPosition(directory=None):
'''Return the "commit-position" of the Chromium git repo. This should be
equivalent to the SVN revision if one exists.
'''
@@ -116,7 +115,7 @@ def FetchGitCommitPosition(directory=None):
for line in reversed(lines):
if line.startswith('Cr-Commit-Position:'):
pos = line.rsplit()[-1].strip()
- return lastchange.VersionInfo('git', '%s-%s' % (hsh, pos))
+ return lastchange.VersionInfo('%s-%s' % (hsh, pos))
raise Exception('Unable to fetch a Git Commit Position.')
« no previous file with comments | « no previous file | native_client_sdk/src/build_tools/tests/build_version_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698