diff --git a/git_cl.py b/git_cl.py index 74ece83abb..7b5b52e7cc 100755 --- a/git_cl.py +++ b/git_cl.py @@ -59,7 +59,6 @@ import split_cl import subcommand import subprocess2 import swift_format -import watchlists __version__ = '2.0' @@ -2009,9 +2008,6 @@ class Changelist(object): files = self.GetAffectedFiles(parent, end_commit=end_commit) change_desc = self._GetDescriptionForUpload(options, [parent, end_commit], files) - - watchlist = watchlists.Watchlists(settings.GetRoot()) - self.ExtendCC(watchlist.GetWatchersForPaths(files)) if not options.bypass_hooks: hook_results = self.RunHook(committing=False, may_prompt=not options.force, @@ -2121,12 +2117,7 @@ class Changelist(object): print(f'Processing {_GetCommitCountSummary(*git_diff_args)}...') - # Apply watchlists on upload. - watchlist = watchlists.Watchlists(settings.GetRoot()) files = self.GetAffectedFiles(base_branch) - if not options.bypass_watchlists: - self.ExtendCC(watchlist.GetWatchersForPaths(files)) - change_desc = self._GetDescriptionForUpload(options, git_diff_args, files) if not options.bypass_hooks: @@ -4847,7 +4838,8 @@ def CMDupload(parser, args): parser.add_option('--bypass-watchlists', action='store_true', dest='bypass_watchlists', - help='bypass watchlists auto CC-ing reviewers') + help='DEPRECATED: bypass watchlists auto CC-ing ' + 'reviewers. This no longer has any effect.') parser.add_option('-f', '--force', action='store_true', @@ -5037,6 +5029,9 @@ def CMDupload(parser, args): if options.skip_title and options.title: parser.error('Only one of --title and --skip-title allowed.') + if options.bypass_watchlists: + print('The --bypass-watchlists flag is deprecated and has no effect.') + if options.use_commit_queue: options.send_mail = True diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py index 8d7f4dc1ff..b70d8c5687 100755 --- a/tests/git_cl_test.py +++ b/tests/git_cl_test.py @@ -113,15 +113,6 @@ class GitMocks(object): del self.config[key] -class WatchlistsMock(object): - def __init__(self, _): - pass - - @staticmethod - def GetWatchersForPaths(_): - return ['joe@example.com'] - - class CodereviewSettingsFileMock(object): def __init__(self): pass @@ -612,7 +603,6 @@ class TestGitCl(unittest.TestCase): return_value={ 'more_cc': ['test-more-cc@chromium.org'] }).start() - mock.patch('git_cl.watchlists.Watchlists', WatchlistsMock).start() mock.patch('git_cl.auth.Authenticator', AuthenticatorMock).start() mock.patch('gerrit_util.GetChangeDetail').start() mock.patch( @@ -939,7 +929,7 @@ class TestGitCl(unittest.TestCase): ref_suffix_list.append('r=%s' % r) metrics_arguments.append('r') if issue is None: - cc += ['test-more-cc@chromium.org', 'joe@example.com'] + cc += ['test-more-cc@chromium.org'] for c in sorted(cc): ref_suffix_list.append('cc=%s' % c) metrics_arguments.append('cc') @@ -948,21 +938,18 @@ class TestGitCl(unittest.TestCase): # TODO(crbug/877717): remove this case. calls += [(('ValidAccounts', '%s-review.googlesource.com' % short_hostname, - sorted(reviewers) + - ['joe@example.com', 'test-more-cc@chromium.org'] + cc), + sorted(reviewers) + ['test-more-cc@chromium.org'] + cc), { e: { 'email': e } - for e in (reviewers + ['joe@example.com'] + cc) + for e in (reviewers + cc) })] for r in sorted(reviewers): if r != 'bad-account-or-email': ref_suffix_list.append('r=%s' % r) metrics_arguments.append('r') reviewers.remove(r) - if issue is None: - cc += ['joe@example.com'] for c in sorted(cc): ref_suffix_list.append('cc=%s' % c) metrics_arguments.append('cc')