f3269cd683
Copy file from svn://svn.chromium.org/chrome/branches/dart/1847/src/dartium_tools@264987 over to tools/dartium. Terry: I'll cherry pick your update script from 1908 in a second CL. R=whesse@google.com Review URL: https://codereview.chromium.org//244643006 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35694 260f80e4-7a28-3924-810f-c04153c831b5
41 lines
915 B
Python
Executable File
41 lines
915 B
Python
Executable File
#!/usr/bin/env python
|
|
#
|
|
# Copyright 2012 Google Inc. All Rights Reserved.
|
|
|
|
import subprocess
|
|
import sys
|
|
|
|
def FetchSVNRevision():
|
|
try:
|
|
proc = subprocess.Popen(['svn', 'info'],
|
|
stdout=subprocess.PIPE,
|
|
stderr=subprocess.PIPE,
|
|
cwd='src/dart',
|
|
shell=(sys.platform=='win32'))
|
|
except OSError:
|
|
# command is apparently either not installed or not executable.
|
|
return None
|
|
if not proc:
|
|
return None
|
|
|
|
for line in proc.stdout:
|
|
line = line.strip()
|
|
if not line:
|
|
continue
|
|
key, val = line.split(': ', 1)
|
|
if key == 'Revision':
|
|
return val
|
|
|
|
return None
|
|
|
|
|
|
def main():
|
|
revision = FetchSVNRevision()
|
|
path = 'src/chrome/VERSION'
|
|
text = file(path).readlines()
|
|
text[2] = 'BUILD=d%s\n' % revision
|
|
file(path, 'w').writelines(text)
|
|
|
|
if __name__ == '__main__':
|
|
main()
|