OLD | NEW |
1 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import os | 5 import os |
6 import re | 6 import re |
7 import subprocess | 7 import subprocess |
8 import sys | 8 import sys |
9 | 9 |
10 import breakpad | 10 import breakpad |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 commit = (hook_name == 'pre-cl-dcommit') | 51 commit = (hook_name == 'pre-cl-dcommit') |
52 | 52 |
53 # Create our options based on the command-line args and the current checkout. | 53 # Create our options based on the command-line args and the current checkout. |
54 options = ChangeOptions(commit=commit, upstream_branch=upstream_branch) | 54 options = ChangeOptions(commit=commit, upstream_branch=upstream_branch) |
55 | 55 |
56 # Apply watchlists on upload. | 56 # Apply watchlists on upload. |
57 if not commit: | 57 if not commit: |
58 watchlist = watchlists.Watchlists(options.change.RepositoryRoot()) | 58 watchlist = watchlists.Watchlists(options.change.RepositoryRoot()) |
59 files = [f.LocalPath() for f in options.change.AffectedFiles()] | 59 files = [f.LocalPath() for f in options.change.AffectedFiles()] |
60 watchers = watchlist.GetWatchersForPaths(files) | 60 watchers = watchlist.GetWatchersForPaths(files) |
61 Backquote(['git', 'config', '--add', | 61 Backquote(['git', 'config', '--replace-all', |
62 'rietveld.extracc', ','.join(watchers)]) | 62 'rietveld.extracc', ','.join(watchers)]) |
63 | 63 |
64 # Run the presubmit checks. | 64 # Run the presubmit checks. |
65 if presubmit_support.DoPresubmitChecks(options.change, | 65 if presubmit_support.DoPresubmitChecks(options.change, |
66 options.commit, | 66 options.commit, |
67 options.verbose, | 67 options.verbose, |
68 sys.stdout, | 68 sys.stdout, |
69 sys.stdin, | 69 sys.stdin, |
70 options.default_presubmit, | 70 options.default_presubmit, |
71 options.may_prompt): | 71 options.may_prompt): |
72 sys.exit(0) | 72 sys.exit(0) |
73 else: | 73 else: |
74 sys.exit(1) | 74 sys.exit(1) |
OLD | NEW |