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

Unified Diff: owners.py

Issue 2148683003: Fix relative file: paths in OWNERS with roots other than '/' (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 5 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 | testing_support/filesystem_mock.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: owners.py
diff --git a/owners.py b/owners.py
index 563675a15bce4743b2d0d65df6da58289120789b..56311e40e699c3d8dccb03c9723dae3aeb265ce1 100644
--- a/owners.py
+++ b/owners.py
@@ -99,7 +99,7 @@ class Database(object):
root: the path to the root of the Repository
open: function callback to open a text file for reading
os_path: module/object callback with fields for 'abspath', 'dirname',
- 'exists', and 'join'
+ 'exists', 'join', and 'relpath'
glob: function callback to list entries in a directory match a glob
(i.e., glob.glob)
"""
@@ -292,7 +292,7 @@ class Database(object):
include_path = path[2:]
else:
assert start.startswith(self.root)
- start = self.os_path.dirname(start[len(self.root):])
+ start = self.os_path.dirname(self.os_path.relpath(start, self.root))
include_path = self.os_path.join(start, path)
owners_path = self.os_path.join(self.root, include_path)
« no previous file with comments | « no previous file | testing_support/filesystem_mock.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698