diff --git a/git_cl.py b/git_cl.py index b38dd74a1..bca26568e 100755 --- a/git_cl.py +++ b/git_cl.py @@ -4803,8 +4803,13 @@ def CMDowners(parser, args): affected_files = cl.GetAffectedFiles(base_branch) if options.batch: - db = owners.Database(root, open, os.path) - print('\n'.join(db.reviewers_for(affected_files, author))) + project = cl.GetGerritProject() + branch = cl.GetCommonAncestorWithUpstream() + client = owners_client.DepotToolsClient( + host=cl.GetGerritHost(), + root=settings.GetRoot(), + branch=branch) + print('\n'.join(client.SuggestOwners(project, branch, affected_files))) return 0 owner_files = [f for f in affected_files if 'OWNERS' in os.path.basename(f)] diff --git a/owners_client.py b/owners_client.py index 4cc48a9f0..7bd6ec88d 100644 --- a/owners_client.py +++ b/owners_client.py @@ -148,7 +148,7 @@ class DepotToolsClient(OwnersClient): def _GetOriginalOwnersFiles(self): return { - f: scm.GIT.GetOldContents(self._root, f, self._branch) + f: scm.GIT.GetOldContents(self._root, f, self._branch).splitlines() for _, f in scm.GIT.CaptureStatus(self._root, self._branch) if os.path.basename(f) == 'OWNERS' }