Browse Source

git_cl: Add flag for owners override

This allows setting OO+1 with `git cl upload --enable-owners-override`.

R=sokcevic@chromium.org

Bug: None
Change-Id: Iddac69653a539a15beee38ea4957be1a9b19b57a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6340467
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Peter Wen <wnwen@chromium.org>
Auto-Submit: Peter Wen <wnwen@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Peter Wen 5 months ago
parent
commit
5d5ea66f01
2 changed files with 8 additions and 0 deletions
  1. 5 0
      git_cl.py
  2. 3 0
      tests/git_cl_test.py

+ 5 - 0
git_cl.py

@@ -1965,6 +1965,8 @@ class Changelist(object):
 
 
         if options.enable_auto_submit:
         if options.enable_auto_submit:
             refspec_opts.append('l=Auto-Submit+1')
             refspec_opts.append('l=Auto-Submit+1')
+        if options.enable_owners_override:
+            refspec_opts.append('l=Owners-Override+1')
         if options.set_bot_commit:
         if options.set_bot_commit:
             refspec_opts.append('l=Bot-Commit+1')
             refspec_opts.append('l=Bot-Commit+1')
         if options.use_commit_queue:
         if options.use_commit_queue:
@@ -5346,6 +5348,9 @@ def CMDupload(parser, args):
         help='Sends your change to the CQ after an approval. Only '
         help='Sends your change to the CQ after an approval. Only '
         'works on repos that have the Auto-Submit label '
         'works on repos that have the Auto-Submit label '
         'enabled')
         'enabled')
+    parser.add_option('--enable-owners-override',
+                      action='store_true',
+                      help='Adds the Owners-Override label to your change.')
     parser.add_option(
     parser.add_option(
         '--parallel',
         '--parallel',
         action='store_true',
         action='store_true',

+ 3 - 0
tests/git_cl_test.py

@@ -1437,6 +1437,7 @@ class TestGitCl(unittest.TestCase):
         options.message = 'honk stonk'
         options.message = 'honk stonk'
         options.topic = 'circus'
         options.topic = 'circus'
         options.enable_auto_submit = False
         options.enable_auto_submit = False
+        options.enable_owners_override = False
         options.set_bot_commit = False
         options.set_bot_commit = False
         options.cq_dry_run = False
         options.cq_dry_run = False
         options.use_commit_queue = False
         options.use_commit_queue = False
@@ -1520,6 +1521,7 @@ class TestGitCl(unittest.TestCase):
         options.message = 'honk stonk'
         options.message = 'honk stonk'
         options.topic = 'circus'
         options.topic = 'circus'
         options.enable_auto_submit = False
         options.enable_auto_submit = False
+        options.enable_owners_override = False
         options.set_bot_commit = False
         options.set_bot_commit = False
         options.cq_dry_run = False
         options.cq_dry_run = False
         options.use_commit_queue = False
         options.use_commit_queue = False
@@ -1586,6 +1588,7 @@ class TestGitCl(unittest.TestCase):
         options.topic = 'circus'
         options.topic = 'circus'
         options.message = 'honk stonk'
         options.message = 'honk stonk'
         options.enable_auto_submit = False
         options.enable_auto_submit = False
+        options.enable_owners_override = False
         options.set_bot_commit = False
         options.set_bot_commit = False
         options.cq_dry_run = False
         options.cq_dry_run = False
         options.use_commit_queue = False
         options.use_commit_queue = False