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>
diff --git a/split_cl.py b/split_cl.py
index 0f3e2f9..37cb1e2 100644
--- a/split_cl.py
+++ b/split_cl.py
@@ -16,7 +16,6 @@
import gclient_utils
import git_footers
-import owners_client
import scm
import git_common as git
@@ -218,10 +217,6 @@
assert refactor_branch_upstream, \
"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)
num_cls = len(files_split_by_owners)
@@ -244,8 +239,8 @@
# and comment.
directory = directory.replace(os.path.sep, '/')
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:
PrintClInfo(cl_index, num_cls, directory, file_paths, description,
reviewers)