summaryrefslogtreecommitdiffstats
path: root/chrome/test/chromedriver/embed_version_in_cpp.py
diff options
context:
space:
mode:
authorsamuong <samuong@chromium.org>2014-10-01 15:03:10 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-01 22:03:53 +0000
commit3516768462b8c570aa3e9c435c104fb02c725bb8 (patch)
treece2d74f5386096661900be51888eea15e8680aca /chrome/test/chromedriver/embed_version_in_cpp.py
parent618e1a78bf2be6ea17d20f21f457d57f79346b22 (diff)
downloadchromium_src-3516768462b8c570aa3e9c435c104fb02c725bb8.zip
chromium_src-3516768462b8c570aa3e9c435c104fb02c725bb8.tar.gz
chromium_src-3516768462b8c570aa3e9c435c104fb02c725bb8.tar.bz2
[chromedriver] Make version string look nicer
BUG= Review URL: https://codereview.chromium.org/615223007 Cr-Commit-Position: refs/heads/master@{#297720}
Diffstat (limited to 'chrome/test/chromedriver/embed_version_in_cpp.py')
-rwxr-xr-xchrome/test/chromedriver/embed_version_in_cpp.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/chrome/test/chromedriver/embed_version_in_cpp.py b/chrome/test/chromedriver/embed_version_in_cpp.py
index 2c452b8..b7f953b 100755
--- a/chrome/test/chromedriver/embed_version_in_cpp.py
+++ b/chrome/test/chromedriver/embed_version_in_cpp.py
@@ -7,6 +7,7 @@
import optparse
import os
+import re
import sys
import chrome_paths
@@ -26,8 +27,17 @@ def main():
version = open(options.version_file, 'r').read().strip()
revision = lastchange.FetchVersionInfo(None).revision
+
if revision:
- version += '.' + revision.strip()
+ match = re.match('([0-9a-fA-F]+)(-refs/heads/master@{#(\d+)})?', revision)
+ if match:
+ git_hash = match.group(1)
+ commit_position = match.group(3)
+ if commit_position:
+ version += '.' + commit_position
+ version += ' (%s)' % git_hash
+ else:
+ version += ' (%s)' % revision
global_string_map = {
'kChromeDriverVersion': version