| OLD | NEW |
| 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 import os | 6 import os |
| 7 import sys | 7 import sys |
| 8 from utils import commit | 8 from utils import commit |
| 9 from utils import mojo_root_dir | 9 from utils import mojo_root_dir |
| 10 from utils import system | 10 from utils import system |
| 11 | 11 |
| 12 dirs_to_clone = [ | 12 dirs_to_clone = [ |
| 13 "mojo/edk", | 13 "mojo/edk", |
| 14 "mojo/public", | 14 "mojo/public", |
| 15 "mojo/services/public", | 15 "mojo/services/public", |
| 16 "mojo/services/view_manager/public", |
| 17 "mojo/services/window_manager/public", |
| 16 ] | 18 ] |
| 17 | 19 |
| 18 def rev(source_dir, chromium_dir): | 20 def rev(source_dir, chromium_dir): |
| 19 src_commit = system(["git", "show-ref", "HEAD", "-s"], cwd=source_dir).strip() | 21 src_commit = system(["git", "show-ref", "HEAD", "-s"], cwd=source_dir).strip() |
| 20 | 22 |
| 21 for d in dirs_to_clone: | 23 for d in dirs_to_clone: |
| 22 print "removing directory %s" % d | 24 print "removing directory %s" % d |
| 23 system(["git", "rm", "-r", d], cwd=chromium_dir) | 25 system(["git", "rm", "-r", d], cwd=chromium_dir) |
| 24 print "cloning directory %s" % d | 26 print "cloning directory %s" % d |
| 25 files = system(["git", "ls-files", d], cwd=source_dir) | 27 files = system(["git", "ls-files", d], cwd=source_dir) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 37 with open("mojo/public/VERSION", "w") as version_file: | 39 with open("mojo/public/VERSION", "w") as version_file: |
| 38 version_file.write(src_commit) | 40 version_file.write(src_commit) |
| 39 system(["git", "add", "mojo/public/VERSION"], cwd=chromium_dir) | 41 system(["git", "add", "mojo/public/VERSION"], cwd=chromium_dir) |
| 40 commit("Update mojo sdk to rev " + src_commit, cwd=chromium_dir) | 42 commit("Update mojo sdk to rev " + src_commit, cwd=chromium_dir) |
| 41 | 43 |
| 42 if len(sys.argv) != 2: | 44 if len(sys.argv) != 2: |
| 43 print "usage: rev_sdk.py <chromium source dir>" | 45 print "usage: rev_sdk.py <chromium source dir>" |
| 44 sys.exit(1) | 46 sys.exit(1) |
| 45 | 47 |
| 46 rev(mojo_root_dir, sys.argv[1]) | 48 rev(mojo_root_dir, sys.argv[1]) |
| OLD | NEW |