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

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

Issue 510133002: [NaCl SDK] Update build_version.ChromeVersion to return "trunk.###" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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: 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 375c24a5fe8d0a04b7282d234dfdf1aa10c73e0b..ced1a2540d5cb0e85c113207a622edd069ef796c 100644
--- a/native_client_sdk/src/build_tools/build_version.py
+++ b/native_client_sdk/src/build_tools/build_version.py
@@ -29,7 +29,7 @@ def ChromeVersion():
Chrome version string or trunk + svn rev.
'''
info = FetchVersionInfo()
- if info.url.startswith('/trunk/'):
+ if info.url == 'refs/heads/master':
return 'trunk.%s' % info.revision
else:
return ChromeVersionNoTrunk()
@@ -110,14 +110,11 @@ def FetchGitCommitPosition(directory=None):
"""
proc = lastchange.RunGitCommand(directory,
['show', '-s', '--format=%B', 'HEAD'])
- pos = ''
if proc:
output = proc.communicate()[0]
if proc.returncode == 0 and output:
for line in reversed(output.splitlines()):
- match = re.search('Cr-Commit-Position: .*@{#(\d+)}', line)
+ match = re.search('Cr-Commit-Position: (.*)@{#(\d+)}', line)
if match:
- pos = match.group(1)
- if not pos:
- return lastchange.VersionInfo(None, None)
- return lastchange.VersionInfo('git', pos)
+ return lastchange.VersionInfo(match.group(1), match.group(2))
+ return lastchange.VersionInfo(None, None)
« 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