Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1332)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/directory_owners_extractor.py

Issue 2684423004: WPT Auto-import: fix for owner list in import CLs. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/w3c/directory_owners_extractor_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/webkitpy/w3c/directory_owners_extractor.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/directory_owners_extractor.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/directory_owners_extractor.py
index a59b1984c771fe63d0d79151b01d603764b520ea..024faccc4a3ee5f372cd03a67b9b12cc69bc8ab7 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/directory_owners_extractor.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/directory_owners_extractor.py
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import collections
import re
from webkitpy.common.system.filesystem import FileSystem
@@ -61,14 +62,15 @@ class DirectoryOwnersExtractor(object):
changed_files: A list of file paths relative to the repository root.
Returns:
- A dict mapping (owner) email addresses to (owned) directories.
+ A dict mapping owner email addresses to lists of owned directories.
"""
tests = [self.finder.layout_test_name(path) for path in changed_files]
tests = [t for t in tests if t is not None]
- email_map = {}
+ email_map = collections.defaultdict(list)
for directory, owners in self.owner_map.iteritems():
owned_tests = [t for t in tests if t.startswith(directory)]
- if owned_tests:
- for owner in owners:
- email_map[owner] = directory
+ if not owned_tests:
+ continue
+ for owner in owners:
+ email_map[owner].append(directory)
return email_map
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/w3c/directory_owners_extractor_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698