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

Side by Side Diff: dartium_tools/roll_forward.py

Issue 239993009: Revert accidental dartium code push (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « dartium_tools/print_dart_version.sh ('k') | dartium_tools/roll_webkit.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 #
3 # Copyright 2012 Google Inc. All Rights Reserved.
4
5 import os
6 import re
7 import shutil
8 import subprocess
9 import sys
10 import update_patched_files
11 import urllib
12
13
14 def GetLkgr():
15 f = urllib.urlopen('http://chromium-status.appspot.com/lkgr')
16 try:
17 return int(f.read())
18 finally:
19 f.close()
20
21
22 def ReadDepsVars(path):
23 exec_globals = {
24 'Var': lambda name: exec_globals['vars'][name],
25 }
26 execfile(path, exec_globals)
27 return exec_globals['vars']
28
29
30 def GetRevision(path, name):
31 return int(ReadDepsVars(path)[name])
32
33
34 def main(argv):
35 CHROMIUM_DEPS_FILE = 'DEPS'
36 DARTIUM_DEPS_FILE = '../dartium.deps/DEPS'
37 CHROMIUM_DEPS_COPY = '../dartium.deps/DEPS.chromium'
38 REV_PATTERN = '"chromium_revision": "(\d+)",'
39
40 deps = file(DARTIUM_DEPS_FILE).read()
41 current_chrome_rev = int(re.search(REV_PATTERN, deps).group(1))
42
43 if len(argv) < 2:
44 next_chrome_rev = GetLkgr()
45 else:
46 next_chrome_rev = int(argv[1])
47
48 print 'Chromium roll: %d -> %d' % (current_chrome_rev, next_chrome_rev)
49
50 if current_chrome_rev == next_chrome_rev:
51 return
52
53 # Update patched files.
54 os.chdir('..')
55 update_patched_files.update_overridden_files(current_chrome_rev, next_chrome_r ev)
56 os.chdir('src')
57
58 # Update DEPS.
59 subprocess.check_call(['svn', 'up', '-r', str(current_chrome_rev), CHROMIUM_DE PS_FILE])
60 current_webkit_rev = GetRevision(CHROMIUM_DEPS_FILE, 'webkit_revision')
61 subprocess.check_call(['svn', 'up', '-r', str(next_chrome_rev), CHROMIUM_DEPS_ FILE])
62 next_webkit_rev = GetRevision(CHROMIUM_DEPS_FILE, 'webkit_revision')
63
64 shutil.copyfile(CHROMIUM_DEPS_FILE, CHROMIUM_DEPS_COPY)
65 deps = deps.replace('"chromium_revision": "%d",' % current_chrome_rev, '"chrom ium_revision": "%d",' % next_chrome_rev)
66 file(DARTIUM_DEPS_FILE, 'w').write(deps)
67
68 # Do webkit roll.
69 WEBKIT_DIR = 'third_party/WebKit'
70 subprocess.check_call(['git', 'svn', 'rebase'], cwd=WEBKIT_DIR)
71 print 'WebKit roll: %d -> %d' % (current_webkit_rev, next_webkit_rev)
72
73 if current_webkit_rev < next_webkit_rev:
74 subprocess.check_call(['bash',
75 '../../dartium_tools/roll_webkit.sh',
76 str(current_webkit_rev), str(next_webkit_rev)], cwd=WEBKIT_DIR)
77
78 # Update the checkout.
79 subprocess.check_call(['gclient', 'sync', '-j17'])
80
81
82
83 if __name__ == '__main__':
84 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « dartium_tools/print_dart_version.sh ('k') | dartium_tools/roll_webkit.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698