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

Unified Diff: webkit/build/webkit_version.py

Issue 6354014: webkit: expose webkit branch and revision number in about pages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: better Created 9 years, 11 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
Index: webkit/build/webkit_version.py
diff --git a/webkit/build/webkit_version.py b/webkit/build/webkit_version.py
index 9f8fbabf89fa05d84955ffcebd8a5343a0dcbb8a..62b45623de60f673f2733b70069aceee3ce96862 100755
--- a/webkit/build/webkit_version.py
+++ b/webkit/build/webkit_version.py
@@ -12,6 +12,9 @@ import os
import re
import sys
+sys.path.insert(0, '../../build/util')
+import lastchange
+
def ReadVersionFile(fname):
'''Reads the Webkit Version.xcconfig file looking for MAJOR_VERSION and
MINOR_VERSION. This function doesn't attempt to support the full syntax
@@ -41,7 +44,12 @@ def EmitVersionHeader(version_file, output_dir):
'''Given webkit's version file, emit a header file that we can use from
within webkit_glue.cc.
'''
+
(major, minor) = ReadVersionFile(version_file)
+ (svn_url, svn_revision) = lastchange.FetchChange(
+ default_lastchange=None,
+ directory=os.path.dirname(version_file))
+
fname = os.path.join(output_dir, "webkit_version.h")
f = open(fname, 'wb')
template = """// webkit_version.h
@@ -49,7 +57,8 @@ def EmitVersionHeader(version_file, output_dir):
#define WEBKIT_VERSION_MAJOR %d
#define WEBKIT_VERSION_MINOR %d
-""" % (version_file, major, minor)
+#define WEBKIT_SVN_REVISION "%s@%s"
+""" % (version_file, major, minor, svn_url, svn_revision)
f.write(template)
f.close()

Powered by Google App Engine
This is Rietveld 408576698