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

Unified Diff: mojo/tools/roll/update_from_chromium.py

Issue 864953003: Teach update_from_chromium.py to preserve certain files through roll. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Response to review Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/config/mojo.gni ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2359b0e5932a46da75ee42c5e3d4e4347d4e7af0 100755
--- a/mojo/tools/roll/update_from_chromium.py
+++ b/mojo/tools/roll/update_from_chromium.py
@@ -88,6 +88,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 +127,17 @@ def main():
"snapshot of things imported from chromium.")
parser.add_argument("chromium_dir", help="chromium source dir")
args = parser.parse_args()
+ pre_roll_commit = system(
+ ["git", "rev-parse", "HEAD"], cwd=mojo_root_dir).strip()
+
rev(args.chromium_dir)
patch.patch()
+
+ print "Restoring files whose contents don't track Chromium"
+ for f in files_not_to_roll:
+ system(["git", "checkout", pre_roll_commit, "--", f], cwd=mojo_root_dir)
+ if files_not_to_roll:
+ commit("Restored pre-roll versions of files that don't get rolled")
return 0
if __name__ == "__main__":
« no previous file with comments | « build/config/mojo.gni ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698