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

Side by Side Diff: git_cl.py

Issue 23185006: Pretty-print the CL description during commit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Comments Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 import difflib 10 import difflib
(...skipping 1650 matching lines...) Expand 10 before | Expand all | Expand 10 after
1661 # Keep a separate copy for the commit message. 1661 # Keep a separate copy for the commit message.
1662 if cl.GetIssue(): 1662 if cl.GetIssue():
1663 change_desc.update_reviewers(cl.GetApprovingReviewers()) 1663 change_desc.update_reviewers(cl.GetApprovingReviewers())
1664 1664
1665 commit_desc = ChangeDescription(change_desc.description) 1665 commit_desc = ChangeDescription(change_desc.description)
1666 if cl.GetIssue(): 1666 if cl.GetIssue():
1667 commit_desc.append_footer('Review URL: %s' % cl.GetIssueURL()) 1667 commit_desc.append_footer('Review URL: %s' % cl.GetIssueURL())
1668 if options.contributor: 1668 if options.contributor:
1669 commit_desc.append_footer('Patch from %s.' % options.contributor) 1669 commit_desc.append_footer('Patch from %s.' % options.contributor)
1670 1670
1671 print 'Description:', repr(commit_desc.description) 1671 print('Description:')
1672 print(commit_desc.description)
1672 1673
1673 branches = [base_branch, cl.GetBranchRef()] 1674 branches = [base_branch, cl.GetBranchRef()]
1674 if not options.force: 1675 if not options.force:
1675 print_stats(options.similarity, options.find_copies, branches) 1676 print_stats(options.similarity, options.find_copies, branches)
1676 ask_for_data('About to commit; enter to confirm.') 1677 ask_for_data('About to commit; enter to confirm.')
1677 1678
1678 # We want to squash all this branch's commits into one commit with the proper 1679 # We want to squash all this branch's commits into one commit with the proper
1679 # description. We do this by doing a "reset --soft" to the base branch (which 1680 # description. We do this by doing a "reset --soft" to the base branch (which
1680 # keeps the working copy the same), then dcommitting that. If origin/master 1681 # keeps the working copy the same), then dcommitting that. If origin/master
1681 # has a submodule merge commit, we'll also need to cherry-pick the squashed 1682 # has a submodule merge commit, we'll also need to cherry-pick the squashed
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
2277 GenUsage(parser, 'help') 2278 GenUsage(parser, 'help')
2278 return CMDhelp(parser, argv) 2279 return CMDhelp(parser, argv)
2279 2280
2280 2281
2281 if __name__ == '__main__': 2282 if __name__ == '__main__':
2282 # These affect sys.stdout so do it outside of main() to simplify mocks in 2283 # These affect sys.stdout so do it outside of main() to simplify mocks in
2283 # unit testing. 2284 # unit testing.
2284 fix_encoding.fix_encoding() 2285 fix_encoding.fix_encoding()
2285 colorama.init() 2286 colorama.init()
2286 sys.exit(main(sys.argv[1:])) 2287 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698