From 341592119fc86a47afeae3456eaab8530e8b21b9 Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Tue, 23 Apr 2019 10:28:26 -0700 Subject: [PATCH] build: actually run import-patches on gclient sync (#17885) --- script/apply_all_patches.py | 2 +- script/git-import-patches | 8 +------- script/lib/git.py | 11 +++++++++++ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/script/apply_all_patches.py b/script/apply_all_patches.py index ec5b7dbc94b4..8dd92c65980b 100755 --- a/script/apply_all_patches.py +++ b/script/apply_all_patches.py @@ -10,7 +10,7 @@ from lib.patches import patch_from_dir def apply_patches(dirs): for patch_dir, repo in dirs.iteritems(): - git.am(repo=repo, patch_data=patch_from_dir(patch_dir), + git.import_patches(repo=repo, patch_data=patch_from_dir(patch_dir), committer_name="Electron Scripts", committer_email="scripts@electron") diff --git a/script/git-import-patches b/script/git-import-patches index 5401f371a695..3f0fb54a5dec 100755 --- a/script/git-import-patches +++ b/script/git-import-patches @@ -17,13 +17,7 @@ def main(argv): help="use 3-way merge to resolve conflicts") args = parser.parse_args(argv) - # save the upstream HEAD so we can refer to it when we later export patches - git.update_ref( - repo='.', - ref='refs/patches/upstream-head', - newvalue='HEAD' - ) - git.am( + git.import_patches( repo='.', patch_data=patch_from_dir(args.patch_dir), threeway=args.threeway diff --git a/script/lib/git.py b/script/lib/git.py index ef2b0bab44e0..c7deb20439f5 100644 --- a/script/lib/git.py +++ b/script/lib/git.py @@ -86,6 +86,17 @@ def apply_patch(repo, patch_path, directory=None, index=False, reverse=False): return applied_successfully +def import_patches(repo, **kwargs): + """same as am(), but we save the upstream HEAD so we can refer to it when we + later export patches""" + update_ref( + repo=repo, + ref='refs/patches/upstream-head', + newvalue='HEAD' + ) + am(repo=repo, **kwargs) + + def get_patch(repo, commit_hash): args = ['git', '-C', repo, 'diff-tree', '-p',