diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-05-10 07:10:09 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-05-10 07:10:09 +0000 |
commit | 836cde1fd7aa7f58f421ea96f2c1e2e318c09356 (patch) | |
tree | b0522edde1d3c5356c95eb1ee2eae3e87befa1f3 /llvm_tools/git.py | |
parent | f3bf46bb50d5113aa736e03885bb2d80e0e9e290 (diff) | |
parent | 882a18888febb9cb0b9d6c6069498cbc4aa30f88 (diff) | |
download | toolchain-utils-836cde1fd7aa7f58f421ea96f2c1e2e318c09356.tar.gz |
Snap for 8564071 from 882a18888febb9cb0b9d6c6069498cbc4aa30f88 to mainline-conscrypt-releaseaml_con_331413000aml_con_331411000aml_con_331312000aml_con_331115000aml_con_331011010android13-mainline-conscrypt-release
Change-Id: I117939d2cb57e282403503297a15d6317ddfba34
Diffstat (limited to 'llvm_tools/git.py')
-rwxr-xr-x | llvm_tools/git.py | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/llvm_tools/git.py b/llvm_tools/git.py index f38d5e72..22c7002a 100755 --- a/llvm_tools/git.py +++ b/llvm_tools/git.py @@ -65,14 +65,14 @@ def DeleteBranch(repo, branch): if not os.path.isdir(repo): raise ValueError('Invalid directory path provided: %s' % repo) - subprocess.check_output(['git', '-C', repo, 'checkout', 'cros/master']) + subprocess.check_output(['git', '-C', repo, 'checkout', 'cros/main']) subprocess.check_output(['git', '-C', repo, 'reset', 'HEAD', '--hard']) subprocess.check_output(['git', '-C', repo, 'branch', '-D', branch]) -def UploadChanges(repo, branch, commit_messages): +def UploadChanges(repo, branch, commit_messages, reviewers=None, cc=None): """Uploads the changes in the specifed branch of the given repo for review. Args: @@ -80,6 +80,8 @@ def UploadChanges(repo, branch, commit_messages): branch: The name of the branch to upload. commit_messages: A string of commit message(s) (i.e. '[message]' of the changes made. + reviewers: A list of reviewers to add to the CL. + cc: A list of contributors to CC about the CL. Returns: A nametuple that has two (key, value) pairs, where the first pair is the @@ -101,12 +103,24 @@ def UploadChanges(repo, branch, commit_messages): subprocess.check_output(['git', 'commit', '-F', f.name], cwd=repo) # Upload the changes for review. + git_args = [ + 'repo', + 'upload', + '--yes', + f'--reviewers={",".join(reviewers)}' if reviewers else '--ne', + '--no-verify', + f'--br={branch}', + ] + + if cc: + git_args.append(f'--cc={",".join(cc)}') + out = subprocess.check_output( - ['repo', 'upload', '--yes', '--ne', '--no-verify', - '--br=%s' % branch], + git_args, stderr=subprocess.STDOUT, cwd=repo, - encoding='utf-8') + encoding='utf-8', + ) print(out) |