From ef966222c9c2816cae5731953d4f44dd2423aca3 Mon Sep 17 00:00:00 2001 From: "rmistry@google.com" Date: Tue, 7 Apr 2015 11:15:01 +0000 Subject: [PATCH] Add ability to CQ dry run patchsets during "git cl upload". The corresponding Rietveld change is here: https://codereview.chromium.org/1054683003/ BUG=chromium:472690 Review URL: https://codereview.chromium.org/1053653004 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@294699 0039d316-1c4b-4281-b951-d872f2087c98 --- git_cl.py | 6 ++++++ third_party/upload.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/git_cl.py b/git_cl.py index 6470575fd..4eee3f152 100755 --- a/git_cl.py +++ b/git_cl.py @@ -1942,6 +1942,9 @@ def RietveldUpload(options, args, cl, change): if project: upload_args.extend(['--project', project]) + if options.cq_dry_run: + upload_args.extend(['--cq_dry_run']) + try: upload_args = ['upload'] + upload_args + args logging.info('upload.RealMain(%s)', upload_args) @@ -2022,6 +2025,9 @@ def CMDupload(parser, args): help='email address to use to connect to Rietveld') parser.add_option('--tbr-owners', dest='tbr_owners', action='store_true', help='add a set of OWNERS to TBR') + parser.add_option('--cq-dry-run', dest='cq_dry_run', action='store_true', + help='Send the patchset to do a CQ dry run right after ' + 'upload.') add_git_similarity(parser) (options, args) = parser.parse_args(args) diff --git a/third_party/upload.py b/third_party/upload.py index 1940fd386..0aae84c1e 100755 --- a/third_party/upload.py +++ b/third_party/upload.py @@ -654,6 +654,9 @@ group.add_option("--target_ref", action="store", dest="target_ref", default=None, help="The target ref that is transitively tracked by the " "local branch this patch comes from.") +parser.add_option("--cq_dry_run", action="store_true", + help="Send the patchset to do a CQ dry run right after " + "upload.") group.add_option("--download_base", action="store_true", dest="download_base", default=False, help="Base files will be downloaded by the server " @@ -2611,6 +2614,9 @@ def RealMain(argv, data=None): form_fields.append(("project", options.project)) if options.target_ref: form_fields.append(("target_ref", options.target_ref)) + if options.cq_dry_run: + form_fields.append(("cq_dry_run", "1")) + form_fields.append(("commit", "1")) # Process --message, --title and --file. message = options.message or ""