OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # Copyright (C) 2008 Evan Martin <martine@danga.com> | 6 # Copyright (C) 2008 Evan Martin <martine@danga.com> |
7 | 7 |
8 """A git-command for integrating reviews on Rietveld.""" | 8 """A git-command for integrating reviews on Rietveld.""" |
9 | 9 |
10 from distutils.version import LooseVersion | 10 from distutils.version import LooseVersion |
(...skipping 1676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1687 args = [base_branch, 'HEAD'] | 1687 args = [base_branch, 'HEAD'] |
1688 | 1688 |
1689 # Apply watchlists on upload. | 1689 # Apply watchlists on upload. |
1690 change = cl.GetChange(base_branch, None) | 1690 change = cl.GetChange(base_branch, None) |
1691 watchlist = watchlists.Watchlists(change.RepositoryRoot()) | 1691 watchlist = watchlists.Watchlists(change.RepositoryRoot()) |
1692 files = [f.LocalPath() for f in change.AffectedFiles()] | 1692 files = [f.LocalPath() for f in change.AffectedFiles()] |
1693 if not options.bypass_watchlists: | 1693 if not options.bypass_watchlists: |
1694 cl.SetWatchers(watchlist.GetWatchersForPaths(files)) | 1694 cl.SetWatchers(watchlist.GetWatchersForPaths(files)) |
1695 | 1695 |
1696 if not options.bypass_hooks: | 1696 if not options.bypass_hooks: |
| 1697 if options.reviewers: |
| 1698 # Set the reviewer list now so that presubmit checks can access it. |
| 1699 change_description = ChangeDescription(change.FullDescriptionText()) |
| 1700 change_description.update_reviewers(options.reviewers) |
| 1701 change.SetDescriptionText(change_description.description) |
1697 hook_results = cl.RunHook(committing=False, | 1702 hook_results = cl.RunHook(committing=False, |
1698 may_prompt=not options.force, | 1703 may_prompt=not options.force, |
1699 verbose=options.verbose, | 1704 verbose=options.verbose, |
1700 change=change) | 1705 change=change) |
1701 if not hook_results.should_continue(): | 1706 if not hook_results.should_continue(): |
1702 return 1 | 1707 return 1 |
1703 if not options.reviewers and hook_results.reviewers: | 1708 if not options.reviewers and hook_results.reviewers: |
1704 options.reviewers = hook_results.reviewers.split(',') | 1709 options.reviewers = hook_results.reviewers.split(',') |
1705 | 1710 |
1706 if cl.GetIssue(): | 1711 if cl.GetIssue(): |
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2535 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 2540 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
2536 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 2541 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
2537 | 2542 |
2538 | 2543 |
2539 if __name__ == '__main__': | 2544 if __name__ == '__main__': |
2540 # These affect sys.stdout so do it outside of main() to simplify mocks in | 2545 # These affect sys.stdout so do it outside of main() to simplify mocks in |
2541 # unit testing. | 2546 # unit testing. |
2542 fix_encoding.fix_encoding() | 2547 fix_encoding.fix_encoding() |
2543 colorama.init() | 2548 colorama.init() |
2544 sys.exit(main(sys.argv[1:])) | 2549 sys.exit(main(sys.argv[1:])) |
OLD | NEW |