Commit d6bf517d authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Improved comments for the recent optimization in owners.py

The final improvement of the patch, better comments, was never
included in the CL that got checked in. Here they are.

Bug: 920591
Change-Id: I2a5f7f67d4bbc5b40fdb0e7021795cd204d6f0c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1583772
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: 's avatarDirk Pranke <dpranke@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
parent 5716400a
......@@ -125,9 +125,8 @@ class Database(object):
# Mapping of owners to the paths or globs they own.
self._owners_to_paths = {EVERYONE: set()}
# Mappings of paths to authorized owners, via the longest path with no
# glob in it.
# For instance "chrome/browser" -> "chrome/browser/*.h" -> ("john", "maria")
# Mappings of directories -> globs in the directory -> owners
# Example: "chrome/browser" -> "chrome/browser/*.h" -> ("john", "maria")
self._paths_to_owners = {}
# Mapping reviewers to the preceding comment per file in the OWNERS files.
......@@ -137,9 +136,13 @@ class Database(object):
self._fnmatch_cache = {}
# Sets of paths that stop us from looking above them for owners.
# (This is implicitly true for the root directory). They are organized
# by glob free path so that a 'ui/events/devices/mojo/*_struct_traits*.*'
# rule would be found in 'ui/events/devices/mojo'.
# (This is implicitly true for the root directory).
#
# The implementation is a mapping:
# Directory -> globs in the directory,
#
# Example:
# 'ui/events/devices/mojo' -> 'ui/events/devices/mojo/*_struct_traits*.*'
self._stop_looking = {'': set([''])}
# Set of files which have already been read.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment