From 3db87198583bb2bc05d80ebfefc0ce10d725346c Mon Sep 17 00:00:00 2001 From: "jrg@chromium.org" Date: Thu, 3 Dec 2009 21:04:17 +0000 Subject: [PATCH] http://codereview.chromium.org/460038 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@33716 0039d316-1c4b-4281-b951-d872f2087c98 --- git_cl_hooks.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/git_cl_hooks.py b/git_cl_hooks.py index 81d48cea0..70c4f3201 100644 --- a/git_cl_hooks.py +++ b/git_cl_hooks.py @@ -11,6 +11,7 @@ import breakpad import presubmit_support import scm +import watchlists def Backquote(cmd, cwd=None): """Like running `cmd` in a shell script.""" @@ -52,6 +53,14 @@ def RunHooks(hook_name, upstream_branch): # Create our options based on the command-line args and the current checkout. options = ChangeOptions(commit=commit, upstream_branch=upstream_branch) + # Apply watchlists on upload. + if not commit: + watchlist = watchlists.Watchlists(options.change.RepositoryRoot()) + files = [f.LocalPath() for f in options.change.AffectedFiles()] + watchers = watchlist.GetWatchersForPaths(files) + Backquote(['git', 'config', '--add', + 'rietveld.extra_cc', ','.join(watchers)]) + # Run the presubmit checks. if presubmit_support.DoPresubmitChecks(options.change, options.commit,