Browse Source

split-cl: Use code owners plugin if available.

Change-Id: I2263d8c1bc48ba0f64bcd5e665d8eb6ea451f1cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2693916
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Edward Lesmes 4 years ago
parent
commit
15234017ec
1 changed files with 2 additions and 7 deletions
  1. 2 7
      split_cl.py

+ 2 - 7
split_cl.py

@@ -16,7 +16,6 @@ import tempfile
 
 
 import gclient_utils
 import gclient_utils
 import git_footers
 import git_footers
-import owners_client
 import scm
 import scm
 
 
 import git_common as git
 import git_common as git
@@ -218,10 +217,6 @@ def SplitCl(description_file, comment_file, changelist, cmd_upload, dry_run,
     assert refactor_branch_upstream, \
     assert refactor_branch_upstream, \
         "Branch %s must have an upstream." % refactor_branch
         "Branch %s must have an upstream." % refactor_branch
 
 
-    client = owners_client.DepotToolsClient(
-        root=repository_root,
-        branch=refactor_branch_upstream)
-
     files_split_by_owners = GetFilesSplitByOwners(files)
     files_split_by_owners = GetFilesSplitByOwners(files)
 
 
     num_cls = len(files_split_by_owners)
     num_cls = len(files_split_by_owners)
@@ -244,8 +239,8 @@ def SplitCl(description_file, comment_file, changelist, cmd_upload, dry_run,
       # and comment.
       # and comment.
       directory = directory.replace(os.path.sep, '/')
       directory = directory.replace(os.path.sep, '/')
       file_paths = [f for _, f in files]
       file_paths = [f for _, f in files]
-      reviewers = client.SuggestOwners(
-          file_paths, exclude=[author, owners_client.OwnersClient.EVERYONE])
+      reviewers = cl.owners_client.SuggestOwners(
+          file_paths, exclude=[author, cl.owners_client.EVERYONE])
       if dry_run:
       if dry_run:
         PrintClInfo(cl_index, num_cls, directory, file_paths, description,
         PrintClInfo(cl_index, num_cls, directory, file_paths, description,
                     reviewers)
                     reviewers)