mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
[owners] Add BatchListOwners
BatchListOwners uses git_common's ScopedPool method to run ListOwnersForFile in parallel for multiple paths. Change-Id: I545072e16181407665c8b009f87fccfb7355d7d8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2585657 Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org> Commit-Queue: Gavin Mak <gavinmak@google.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import os
|
||||
import random
|
||||
|
||||
import gerrit_util
|
||||
import git_common
|
||||
import owners as owners_db
|
||||
import scm
|
||||
|
||||
@@ -66,6 +67,12 @@ class OwnersClient(object):
|
||||
"""
|
||||
raise Exception('Not implemented')
|
||||
|
||||
def BatchListOwners(self, project, branch, paths):
|
||||
"""Returns a dictionary {path: [owners]}."""
|
||||
with git_common.ScopedPool(kind='threads') as pool:
|
||||
return dict(pool.imap_unordered(
|
||||
lambda p: (p, self.ListOwnersForFile(project, branch, p)), paths))
|
||||
|
||||
def GetChangeApprovalStatus(self, change_id):
|
||||
"""Check the approval status for the latest revision_id in a change.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user