diff options
Diffstat (limited to 'llvm_tools/patch_sync/src')
-rw-r--r-- | llvm_tools/patch_sync/src/main.rs | 11 | ||||
-rw-r--r-- | llvm_tools/patch_sync/src/version_control.rs | 12 |
2 files changed, 18 insertions, 5 deletions
diff --git a/llvm_tools/patch_sync/src/main.rs b/llvm_tools/patch_sync/src/main.rs index 58276151..b7967c31 100644 --- a/llvm_tools/patch_sync/src/main.rs +++ b/llvm_tools/patch_sync/src/main.rs @@ -37,6 +37,7 @@ fn main() -> Result<()> { dry_run, no_commit, wip, + disable_cq, } => transpose_subcmd(TransposeOpt { cros_checkout_path, cros_reviewers: cros_reviewers @@ -53,6 +54,7 @@ fn main() -> Result<()> { dry_run, no_commit, wip, + disable_cq, }), } } @@ -75,7 +77,8 @@ fn show_subcmd(args: ShowOpt) -> Result<()> { cros_checkout: cros_checkout_path, android_checkout: android_checkout_path, sync_before: sync, - wip_mode: true, + wip_mode: true, // Has no effect, as we're not making changes + enable_cq: false, // Has no effect, as we're not uploading anything }; ctx.setup()?; let make_collection = |platform: &str, patches_fp: &Path| -> Result<PatchCollection> { @@ -114,6 +117,7 @@ struct TransposeOpt { cros_reviewers: Vec<String>, android_reviewers: Vec<String>, wip: bool, + disable_cq: bool, } fn transpose_subcmd(args: TransposeOpt) -> Result<()> { @@ -122,6 +126,7 @@ fn transpose_subcmd(args: TransposeOpt) -> Result<()> { android_checkout: args.android_checkout_path, sync_before: args.sync, wip_mode: args.wip, + enable_cq: !args.disable_cq, }; ctx.setup()?; let cros_patches_path = ctx.cros_patches_path(); @@ -318,5 +323,9 @@ enum Opt { /// emails. #[structopt(long)] wip: bool, + + /// Don't run CQ if set. Only has an effect if uploading. + #[structopt(long)] + disable_cq: bool, }, } diff --git a/llvm_tools/patch_sync/src/version_control.rs b/llvm_tools/patch_sync/src/version_control.rs index dc43523e..e07d39d6 100644 --- a/llvm_tools/patch_sync/src/version_control.rs +++ b/llvm_tools/patch_sync/src/version_control.rs @@ -20,6 +20,7 @@ pub struct RepoSetupContext { /// Run `repo sync` before doing any comparisons. pub sync_before: bool, pub wip_mode: bool, + pub enable_cq: bool, } impl RepoSetupContext { @@ -52,7 +53,7 @@ impl RepoSetupContext { llvm_dir.display() ); Self::rev_bump_llvm(&llvm_dir)?; - let mut extra_args = vec!["--label=Commit-Queue+1"]; + let mut extra_args = Vec::new(); for reviewer in reviewers { extra_args.push("--re"); extra_args.push(reviewer.as_ref()); @@ -61,6 +62,9 @@ impl RepoSetupContext { extra_args.push("--wip"); extra_args.push("--no-emails"); } + if self.enable_cq { + extra_args.push("--label=Commit-Queue+1"); + } Self::repo_upload( &self.cros_checkout, CHROMIUMOS_OVERLAY_REL_PATH, @@ -76,9 +80,6 @@ impl RepoSetupContext { pub fn android_repo_upload<S: AsRef<str>>(&self, reviewers: &[S]) -> Result<()> { let mut extra_args = Vec::new(); - // TODO(ajordanr): Presubmit ready can only be enabled if we - // have the permissions. - // extra_args.push("--label=Presubmit-Ready+1"); for reviewer in reviewers { extra_args.push("--re"); extra_args.push(reviewer.as_ref()); @@ -87,6 +88,9 @@ impl RepoSetupContext { extra_args.push("--wip"); extra_args.push("--no-emails"); } + if self.enable_cq { + extra_args.push("--label=Presubmit-Ready+1"); + } Self::repo_upload( &self.android_checkout, ANDROID_LLVM_REL_PATH, |