summaryrefslogtreecommitdiffstats
path: root/mojo/tools/rev_sdk.py
diff options
context:
space:
mode:
authorrockot <rockot@chromium.org>2015-04-24 08:59:32 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-24 16:00:34 +0000
commitaea10852fd84b7b22473aeef85f8adeac6771e56 (patch)
treec317428bea37075e6160d52a15a0ab61911a97ee /mojo/tools/rev_sdk.py
parent70d2cd67184a81c7c8207de3dc0a58a2dcee2a30 (diff)
downloadchromium_src-aea10852fd84b7b22473aeef85f8adeac6771e56.zip
chromium_src-aea10852fd84b7b22473aeef85f8adeac6771e56.tar.gz
chromium_src-aea10852fd84b7b22473aeef85f8adeac6771e56.tar.bz2
Preserve embedded DEPS files during mojo roll
These are no longer part of the mojo repo, but we want to persist them when rolling to chromium. This also brings over the small utils module that the script depends on, with some minor adjustments. Rather than taking the chromium path as an arg and inferring the mojo path, we now do the reverse. BUG=None R=jam@chromium.org Review URL: https://codereview.chromium.org/1102043002 Cr-Commit-Position: refs/heads/master@{#326809}
Diffstat (limited to 'mojo/tools/rev_sdk.py')
-rwxr-xr-xmojo/tools/rev_sdk.py25
1 files changed, 19 insertions, 6 deletions
diff --git a/mojo/tools/rev_sdk.py b/mojo/tools/rev_sdk.py
index c750868..c5cefbc 100755
--- a/mojo/tools/rev_sdk.py
+++ b/mojo/tools/rev_sdk.py
@@ -10,7 +10,7 @@ https://github.com/domokit/mojo/wiki/Rolling-code-between-chromium-and-mojo#mojo
import os
import sys
from utils import commit
-from utils import mojo_root_dir
+from utils import chromium_root_dir
from utils import system
sdk_prefix_in_chromium = "third_party/mojo/src"
@@ -20,9 +20,15 @@ sdk_dirs_to_clone = [
"nacl_bindings",
]
-
-services_prefix_in_mojo = "mojo/services"
-services_prefix_in_chromium = "third_party/mojo_services/src"
+# Individual files to preserve within the target repository during roll. These
+# are relative to |sdk_prefix_in_chromium| but are not maintained in the mojo
+# repository.
+preserved_chromium_files = [
+ "mojo/edk/DEPS",
+ "mojo/public/DEPS",
+ "mojo/public/platform/nacl/DEPS",
+ "nacl_bindings/DEPS",
+]
# A dictionary mapping dirs to clone to their destination locations in Chromium.
dirs_to_clone = {}
@@ -60,10 +66,17 @@ def rev(source_dir, chromium_dir):
with open(version_filename, "w") as version_file:
version_file.write(src_commit)
system(["git", "add", version_filename], cwd=chromium_dir)
+
+ # Reset preserved files that were blown away.
+ for rel_path in preserved_chromium_files:
+ preserved_path = os.path.join(sdk_prefix_in_chromium, rel_path)
+ system(["git", "reset", "--", preserved_path])
+ system(["git", "checkout", preserved_path])
+
commit("Update mojo sdk to rev " + src_commit, cwd=chromium_dir)
if len(sys.argv) != 2:
- print "usage: rev_sdk.py <chromium source dir>"
+ print "usage: rev_sdk.py <mojo source dir>"
sys.exit(1)
-rev(mojo_root_dir, sys.argv[1])
+rev(sys.argv[1], chromium_root_dir)