Эх сурвалжийг харах

Change to slash separator to fix a bug on Windows in owners.py

Some of the owners.py code does not change file path to use the slash
separator, causing owners check to crash on Windows. This CL fixes it.

Change-Id: I6e06a235dbb563ea45691f19b03d826b23184b2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2626090
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Mandy Chen 4 жил өмнө
parent
commit
c13ea848e6
1 өөрчлөгдсөн 6 нэмэгдсэн , 1 устгасан
  1. 6 1
      owners.py

+ 6 - 1
owners.py

@@ -513,7 +513,12 @@ class Database(object):
     return owners
 
   def _covering_set_of_owners_for(self, files, author):
-    dirs_remaining = set(self.enclosing_dir_with_owners(f) for f in files)
+    dirs_remaining = set()
+    for f in files:
+      dir_path = self.enclosing_dir_with_owners(f)
+      # Always use slashes as separators.
+      dirs_remaining.add(dir_path.replace(os.sep, '/'))
+
     all_possible_owners = self.all_possible_owners(dirs_remaining, author)
     suggested_owners = set()
     while dirs_remaining and all_possible_owners: