Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(431)

Side by Side Diff: git_cl.py

Issue 195793021: Infer CL author and reviewer list from local state if the issue has not previously been uploaded. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Add an additional test Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | presubmit_canned_checks.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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:]))
OLDNEW
« no previous file with comments | « no previous file | presubmit_canned_checks.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698