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

Side by Side Diff: mojo/tools/rev_sdk.py

Issue 1100763002: Inject CanAddURLToHistory into TopSitesImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefs
Patch Set: Fix error introduced during rebase Created 5 years, 7 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
« no previous file with comments | « mojo/shell/native_runner_unittest.cc ('k') | mojo/tools/utils.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Tool to roll Mojo into Chromium. See: 6 """Tool to roll Mojo into Chromium. See:
7 https://github.com/domokit/mojo/wiki/Rolling-code-between-chromium-and-mojo#mojo ---chromium-updates-sdk--edk 7 https://github.com/domokit/mojo/wiki/Rolling-code-between-chromium-and-mojo#mojo ---chromium-updates-sdk--edk
8 """ 8 """
9 9
10 import os 10 import os
11 import sys 11 import sys
12 from utils import commit 12 from utils import commit
13 from utils import mojo_root_dir 13 from utils import chromium_root_dir
14 from utils import system 14 from utils import system
15 15
16 sdk_prefix_in_chromium = "third_party/mojo/src" 16 sdk_prefix_in_chromium = "third_party/mojo/src"
17 sdk_dirs_to_clone = [ 17 sdk_dirs_to_clone = [
18 "mojo/edk", 18 "mojo/edk",
19 "mojo/public", 19 "mojo/public",
20 "nacl_bindings", 20 "nacl_bindings",
21 ] 21 ]
22 22
23 23 # Individual files to preserve within the target repository during roll. These
24 services_prefix_in_mojo = "mojo/services" 24 # are relative to |sdk_prefix_in_chromium| but are not maintained in the mojo
25 services_prefix_in_chromium = "third_party/mojo_services/src" 25 # repository.
26 preserved_chromium_files = [
27 "mojo/edk/DEPS",
28 "mojo/public/DEPS",
29 "mojo/public/platform/nacl/DEPS",
30 "nacl_bindings/DEPS",
31 ]
26 32
27 # A dictionary mapping dirs to clone to their destination locations in Chromium. 33 # A dictionary mapping dirs to clone to their destination locations in Chromium.
28 dirs_to_clone = {} 34 dirs_to_clone = {}
29 35
30 for sdk_dir in sdk_dirs_to_clone: 36 for sdk_dir in sdk_dirs_to_clone:
31 sdk_dir_in_chromium = os.path.join(sdk_prefix_in_chromium, sdk_dir) 37 sdk_dir_in_chromium = os.path.join(sdk_prefix_in_chromium, sdk_dir)
32 dirs_to_clone[sdk_dir] = sdk_dir_in_chromium 38 dirs_to_clone[sdk_dir] = sdk_dir_in_chromium
33 39
34 def rev(source_dir, chromium_dir): 40 def rev(source_dir, chromium_dir):
35 src_commit = system(["git", "show-ref", "HEAD", "-s"], cwd=source_dir).strip() 41 src_commit = system(["git", "show-ref", "HEAD", "-s"], cwd=source_dir).strip()
(...skipping 17 matching lines...) Expand all
53 system(["mkdir", "-p", os.path.dirname(dest_path)]) 59 system(["mkdir", "-p", os.path.dirname(dest_path)])
54 system(["cp", os.path.join(source_dir, f), dest_path]) 60 system(["cp", os.path.join(source_dir, f), dest_path])
55 os.chdir(chromium_dir) 61 os.chdir(chromium_dir)
56 system(["git", "add", dest_dir], cwd=chromium_dir) 62 system(["git", "add", dest_dir], cwd=chromium_dir)
57 63
58 mojo_public_dest_dir = os.path.join(sdk_prefix_in_chromium, "mojo/public") 64 mojo_public_dest_dir = os.path.join(sdk_prefix_in_chromium, "mojo/public")
59 version_filename = os.path.join(mojo_public_dest_dir, "VERSION") 65 version_filename = os.path.join(mojo_public_dest_dir, "VERSION")
60 with open(version_filename, "w") as version_file: 66 with open(version_filename, "w") as version_file:
61 version_file.write(src_commit) 67 version_file.write(src_commit)
62 system(["git", "add", version_filename], cwd=chromium_dir) 68 system(["git", "add", version_filename], cwd=chromium_dir)
69
70 # Reset preserved files that were blown away.
71 for rel_path in preserved_chromium_files:
72 preserved_path = os.path.join(sdk_prefix_in_chromium, rel_path)
73 system(["git", "reset", "--", preserved_path])
74 system(["git", "checkout", preserved_path])
75
63 commit("Update mojo sdk to rev " + src_commit, cwd=chromium_dir) 76 commit("Update mojo sdk to rev " + src_commit, cwd=chromium_dir)
64 77
65 if len(sys.argv) != 2: 78 if len(sys.argv) != 2:
66 print "usage: rev_sdk.py <chromium source dir>" 79 print "usage: rev_sdk.py <mojo source dir>"
67 sys.exit(1) 80 sys.exit(1)
68 81
69 rev(mojo_root_dir, sys.argv[1]) 82 rev(sys.argv[1], chromium_root_dir)
OLDNEW
« no previous file with comments | « mojo/shell/native_runner_unittest.cc ('k') | mojo/tools/utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698