| Index: mojo/tools/roll/update_from_chromium.py
|
| diff --git a/mojo/tools/roll/update_from_chromium.py b/mojo/tools/roll/update_from_chromium.py
|
| index 5d2bd4475f757e725a77eb6a82e80bfa4701f4d2..c4d5eacac2a9ca3f8d859449afc08e29be3e9bab 100755
|
| --- a/mojo/tools/roll/update_from_chromium.py
|
| +++ b/mojo/tools/roll/update_from_chromium.py
|
| @@ -12,6 +12,7 @@ import urllib2
|
| from utils import commit
|
| from utils import mojo_root_dir
|
| from utils import system
|
| +from utils import temp_dir
|
|
|
| import patch
|
|
|
| @@ -88,6 +89,10 @@ net_dirs = [
|
| files_to_copy = ["sandbox/sandbox_export.h",
|
| ".clang-format"]
|
|
|
| +# The contents of these files before the roll will be preserved after the roll,
|
| +# even though they live in directories rolled in from Chromium.
|
| +files_not_to_roll = [ "build/config/mojo.gni" ]
|
| +
|
| dirs = dirs_to_snapshot + net_dirs
|
|
|
| def chromium_rev_number(src_commit):
|
| @@ -123,8 +128,20 @@ def main():
|
| "snapshot of things imported from chromium.")
|
| parser.add_argument("chromium_dir", help="chromium source dir")
|
| args = parser.parse_args()
|
| - rev(args.chromium_dir)
|
| - patch.patch()
|
| + with temp_dir() as tempd:
|
| + for f in files_not_to_roll:
|
| + system(["mkdir", "-p", os.path.dirname(f)], cwd=tempd)
|
| + system(["cp", os.path.join(mojo_root_dir, f), os.path.join(tempd, f)])
|
| +
|
| + rev(args.chromium_dir)
|
| + patch.patch()
|
| +
|
| + print "Restoring files whose contents don't track Chromium"
|
| + for f in files_not_to_roll:
|
| + system(["mkdir", "-p", os.path.dirname(f)], cwd=mojo_root_dir)
|
| + system(["cp", os.path.join(tempd, f), os.path.join(mojo_root_dir, f)])
|
| + system(["git", "add", "."], cwd=mojo_root_dir)
|
| + commit("Restored pre-roll versions of files that don't get rolled")
|
| return 0
|
|
|
| if __name__ == "__main__":
|
|
|