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 2527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2538 # Keep a separate copy for the commit message, because the commit message | 2538 # Keep a separate copy for the commit message, because the commit message |
2539 # contains the link to the Rietveld issue, while the Rietveld message contains | 2539 # contains the link to the Rietveld issue, while the Rietveld message contains |
2540 # the commit viewvc url. | 2540 # the commit viewvc url. |
2541 # Keep a separate copy for the commit message. | 2541 # Keep a separate copy for the commit message. |
2542 if cl.GetIssue(): | 2542 if cl.GetIssue(): |
2543 change_desc.update_reviewers(cl.GetApprovingReviewers()) | 2543 change_desc.update_reviewers(cl.GetApprovingReviewers()) |
2544 | 2544 |
2545 commit_desc = ChangeDescription(change_desc.description) | 2545 commit_desc = ChangeDescription(change_desc.description) |
2546 if cl.GetIssue(): | 2546 if cl.GetIssue(): |
2547 # Xcode won't linkify this URL unless there is a non-whitespace character | 2547 # Xcode won't linkify this URL unless there is a non-whitespace character |
2548 # after it. Add a period on a new line to circumvent this. | 2548 # after it. Add a period on a new line to circumvent this. Also add a space |
2549 commit_desc.append_footer('Review URL: %s.' % cl.GetIssueURL()) | 2549 # before the period to make sure that Gitiles continues to correctly resolve |
| 2550 # the URL. |
| 2551 commit_desc.append_footer('Review URL: %s .' % cl.GetIssueURL()) |
2550 if options.contributor: | 2552 if options.contributor: |
2551 commit_desc.append_footer('Patch from %s.' % options.contributor) | 2553 commit_desc.append_footer('Patch from %s.' % options.contributor) |
2552 | 2554 |
2553 print('Description:') | 2555 print('Description:') |
2554 print(commit_desc.description) | 2556 print(commit_desc.description) |
2555 | 2557 |
2556 branches = [merge_base, cl.GetBranchRef()] | 2558 branches = [merge_base, cl.GetBranchRef()] |
2557 if not options.force: | 2559 if not options.force: |
2558 print_stats(options.similarity, options.find_copies, branches) | 2560 print_stats(options.similarity, options.find_copies, branches) |
2559 | 2561 |
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3530 if __name__ == '__main__': | 3532 if __name__ == '__main__': |
3531 # These affect sys.stdout so do it outside of main() to simplify mocks in | 3533 # These affect sys.stdout so do it outside of main() to simplify mocks in |
3532 # unit testing. | 3534 # unit testing. |
3533 fix_encoding.fix_encoding() | 3535 fix_encoding.fix_encoding() |
3534 colorama.init() | 3536 colorama.init() |
3535 try: | 3537 try: |
3536 sys.exit(main(sys.argv[1:])) | 3538 sys.exit(main(sys.argv[1:])) |
3537 except KeyboardInterrupt: | 3539 except KeyboardInterrupt: |
3538 sys.stderr.write('interrupted\n') | 3540 sys.stderr.write('interrupted\n') |
3539 sys.exit(1) | 3541 sys.exit(1) |
OLD | NEW |