diff options
author | haraken@google.com <haraken@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-31 08:51:19 +0000 |
---|---|---|
committer | haraken@google.com <haraken@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-31 08:51:19 +0000 |
commit | a8721e199b98f8cb631940877d921ad167849122 (patch) | |
tree | 350c5008567a4490c993c23da38b13fa917c42ca /chrome/tools/build | |
parent | a65ff9aa616bb8461f26f67a57395af41e4e2eb2 (diff) | |
download | chromium_src-a8721e199b98f8cb631940877d921ad167849122.zip chromium_src-a8721e199b98f8cb631940877d921ad167849122.tar.gz chromium_src-a8721e199b98f8cb631940877d921ad167849122.tar.bz2 |
Unify the version string to be displayed on "About Chromium" dialog. (6/6)
- Update tweak_info_plist to use lastchange.py.
FYI: We decided to split the changes of issue 7104106 (http://codereview.chromium.org/7104106/) into the following steps. This is the sixth step of them:
(1) Add CreateVersionString() to chrome_version_info.*, update the GTK+ code to use it. (reviewer: erg, tony)
(2) Update the mac code to use CreateVersionString(). Update About.xib. (reviewer: mark)
(3) Update the views code to use CreateVersionString(). This can happen at the same time as (2). (reviewer: davemoore, tony)
(4) Update version.bat to use lastchange.py. (reviewer: evan)
(5) Make changes to lastchange.py and webkit_version.py. (reviewer: evan, mark)
(6) Update tweak_info_plist to use lastchange.py. (reviewer: mark)
BUG=37186
TEST=Observe that "About Chromium" dialog shows the version string like "14.0.787.0 (Developer Build 88242 Mac OS X" on Mac.
Review URL: http://codereview.chromium.org/7514042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94855 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/tools/build')
-rwxr-xr-x | chrome/tools/build/mac/tweak_info_plist | 59 |
1 files changed, 6 insertions, 53 deletions
diff --git a/chrome/tools/build/mac/tweak_info_plist b/chrome/tools/build/mac/tweak_info_plist index e856547..37c5cd4 100755 --- a/chrome/tools/build/mac/tweak_info_plist +++ b/chrome/tools/build/mac/tweak_info_plist @@ -31,6 +31,9 @@ import tempfile TOP = os.path.join(env['SRCROOT'], '..') +sys.path.insert(0, os.path.join(TOP, "build/util")) +import lastchange + def _GetOutput(args): """Runs a subprocess and waits for termination. Returns (stdout, returncode) @@ -98,63 +101,13 @@ def _AddVersionKeys(plist): return True -def _GetSCMInfo(): - """Returns a 2-Tuple of (scm_path, scm_revision) for the SVN information.""" - # Attempt to get both the SVN revision number and the branch (or trunk). - scm_revision = None - scm_path = None - - # First attempt to get the SVN revision number and path. - (stdout, retval) = _GetOutputNoError(['svn', 'info', TOP]) - if not retval: - match = re.search('^Revision: ([0-9]+)$', stdout, re.MULTILINE) - if match: - scm_revision = match.group(1) - - match = re.search('^Repository Root: (.+)$', stdout, re.MULTILINE) - if match: - svn_repo_root = match.group(1) - - match = re.search('^URL: (.+)$', stdout, re.MULTILINE) - if match: - svn_url = match.group(1) - - # If there's both a repo root and a URL, find the branch path. - if svn_repo_root and svn_url and svn_url.startswith(svn_repo_root): - # Grab the path to the source root in the Subversion repository by taking - # the URL to the source root directory and the repository root, and - # removing the latter from the former. This ensures that scm_path will - # contain a useful path regardless of the Subversion server, mirror, and - # authentication scheme in use. - scm_path = svn_url[len(svn_repo_root):] - - # If the desired information was found via SVN, return it now. - if scm_revision != None and scm_path != None: - return (scm_path, scm_revision) - - # If a SVN revision number couldn't be found, try getting it through git. - (stdout, retval) = _GetOutputNoError(['git', 'log', '-1', - '--grep=git-svn-id', '--format=%b']) - # Extract both the last changed SVN revision and the branch path (see block - # comment above). - # git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85528 0039d316-1c4b... - if not retval: - match = re.search(r'git-svn-id: .*/(chrome|svn)(/.*)@([0-9]+)', stdout, - re.MULTILINE) - if match: - scm_path = match.group(2) - scm_revision = match.group(3) - - # Finally, return the results (which could be None on error). - return (scm_path, scm_revision) - - def _DoSVNKeys(plist, add_keys): """Adds the SVN information, visible in about:version, to property list. If |add_keys| is True, it will insert the keys, otherwise it will remove them.""" - (scm_path, scm_revision) = None, None + scm_path, scm_revision = None, None if add_keys: - (scm_path, scm_revision) = _GetSCMInfo() + version_info = lastchange.FetchVersionInfo(default_lastchange=None) + scm_path, scm_revision = version_info.url, version_info.revision # See if the operation failed. _RemoveKeys(plist, 'SVNRevision') |