Commit b7f759f6 authored by Edward Lemur's avatar Edward Lemur Committed by LUCI CQ

git-cl: Use open instead of file.

file does not exist on Python 3.

Change-Id: I9392fd797b730784cff4d1144c5a3ab1027c7dd8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2086493Reviewed-by: 's avatarJosip Sokcevic <sokcevic@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
parent 1a83da1f
......@@ -2781,7 +2781,7 @@ class ChangeDescription(object):
# Next, maybe fill in OWNERS coverage gaps to either tbrs/reviewers.
if add_owners_to:
owners_db = owners.Database(change.RepositoryRoot(),
fopen=file, os_path=os.path)
fopen=open, os_path=os.path)
missing_files = owners_db.files_not_covered_by(change.LocalPaths(),
(tbrs | reviewers))
LOOKUP[add_owners_to].update(
......@@ -4944,7 +4944,7 @@ def CMDowners(parser, args):
if options.show_all:
for arg in args:
base_branch = cl.GetCommonAncestorWithUpstream()
database = owners.Database(settings.GetRoot(), file, os.path)
database = owners.Database(settings.GetRoot(), open, os.path)
database.load_data_needed_for([arg])
print('Owners for %s:' % arg)
for owner in sorted(database.all_possible_owners([arg], None)):
......@@ -4963,7 +4963,7 @@ def CMDowners(parser, args):
affected_files = [f.LocalPath() for f in change.AffectedFiles()]
if options.batch:
db = owners.Database(change.RepositoryRoot(), file, os.path)
db = owners.Database(change.RepositoryRoot(), open, os.path)
print('\n'.join(db.reviewers_for(affected_files, author)))
return 0
......@@ -4972,7 +4972,7 @@ def CMDowners(parser, args):
change.RepositoryRoot(),
author,
[] if options.ignore_current else cl.GetReviewers(),
fopen=file, os_path=os.path,
fopen=open, os_path=os.path,
disable_color=options.no_color,
override_files=change.OriginalOwnersFiles(),
ignore_author=options.ignore_self).run()
......
......@@ -208,7 +208,7 @@ def SplitCl(description_file, comment_file, changelist, cmd_upload, dry_run,
assert refactor_branch_upstream, \
"Branch %s must have an upstream." % refactor_branch
owners_database = owners.Database(change.RepositoryRoot(), file, os.path)
owners_database = owners.Database(change.RepositoryRoot(), open, os.path)
owners_database.load_data_needed_for([f.LocalPath() for f in files])
files_split_by_owners = GetFilesSplitByOwners(owners_database, files)
......
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