|
55 | 55 | 'scripts'))
|
56 | 56 |
|
57 | 57 | from build import (AddCMakeToPath, AddZlibToPath, CheckoutGitRepo, CopyFile,
|
58 |
| - DownloadDebianSysroot, GetLibXml2Dirs, LLVM_BUILD_TOOLS_DIR, |
59 |
| - RunCommand) |
| 58 | + DownloadDebianSysroot, GetLibXml2Dirs, GitCherryPick, |
| 59 | + LLVM_BUILD_TOOLS_DIR, RunCommand) |
60 | 60 | from update import (CHROMIUM_DIR, DownloadAndUnpack, EnsureDirExists,
|
61 | 61 | GetDefaultHostOs, RmTree, UpdatePackage)
|
62 | 62 |
|
@@ -553,25 +553,6 @@ def BuildLLVMLibraries(skip_build):
|
553 | 553 | ])
|
554 | 554 |
|
555 | 555 |
|
556 |
| -def GitCherryPick(git_repository, git_remote, commit): |
557 |
| - print(f'Cherry-picking {commit} in {git_repository} from {git_remote}') |
558 |
| - git_cmd = ['git', '-C', git_repository] |
559 |
| - RunCommand(git_cmd + ['remote', 'add', 'github', git_remote], |
560 |
| - fail_hard=False) |
561 |
| - RunCommand(git_cmd + |
562 |
| - ['fetch', '--recurse-submodules=no', 'github', commit]) |
563 |
| - is_ancestor = RunCommand(git_cmd + |
564 |
| - ['merge-base', '--is-ancestor', commit, 'HEAD'], |
565 |
| - fail_hard=False) |
566 |
| - if is_ancestor: |
567 |
| - print('Commit already an ancestor; skipping.') |
568 |
| - return |
569 |
| - RunCommand([ |
570 |
| - 'git', '-C', git_repository, 'cherry-pick', '--keep-redundant-commits', |
571 |
| - commit |
572 |
| - ]) |
573 |
| - |
574 |
| - |
575 | 556 | # Move a git submodule to point to a different branch.
|
576 | 557 | #
|
577 | 558 | # This is super non-trivial because the submodules are shallow, and thus
|
|
0 commit comments