| 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 import datetime | 10 import datetime |
| (...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1503 branch = options.target_branch | 1503 branch = options.target_branch |
| 1504 | 1504 |
| 1505 change_desc = ChangeDescription( | 1505 change_desc = ChangeDescription( |
| 1506 options.message or CreateDescriptionFromLog(args)) | 1506 options.message or CreateDescriptionFromLog(args)) |
| 1507 if not change_desc.description: | 1507 if not change_desc.description: |
| 1508 print "Description is empty; aborting." | 1508 print "Description is empty; aborting." |
| 1509 return 1 | 1509 return 1 |
| 1510 if CHANGE_ID not in change_desc.description: | 1510 if CHANGE_ID not in change_desc.description: |
| 1511 AddChangeIdToCommitMessage(options, args) | 1511 AddChangeIdToCommitMessage(options, args) |
| 1512 | 1512 |
| 1513 commits = RunGit(['rev-list', '%s/%s...' % (remote, branch)]).splitlines() | 1513 commits = RunGit(['rev-list', '%s/%s..' % (remote, branch)]).splitlines() |
| 1514 if len(commits) > 1: | 1514 if len(commits) > 1: |
| 1515 print('WARNING: This will upload %d commits. Run the following command ' | 1515 print('WARNING: This will upload %d commits. Run the following command ' |
| 1516 'to see which commits will be uploaded: ' % len(commits)) | 1516 'to see which commits will be uploaded: ' % len(commits)) |
| 1517 print('git log %s/%s...' % (remote, branch)) | 1517 print('git log %s/%s..' % (remote, branch)) |
| 1518 print('You can also use `git squash-branch` to squash these into a single' | 1518 print('You can also use `git squash-branch` to squash these into a single' |
| 1519 'commit.') | 1519 'commit.') |
| 1520 ask_for_data('About to upload; enter to confirm.') | 1520 ask_for_data('About to upload; enter to confirm.') |
| 1521 | 1521 |
| 1522 if options.reviewers: | 1522 if options.reviewers: |
| 1523 change_desc.update_reviewers(options.reviewers) | 1523 change_desc.update_reviewers(options.reviewers) |
| 1524 | 1524 |
| 1525 receive_options = [] | 1525 receive_options = [] |
| 1526 cc = cl.GetCCList().split(',') | 1526 cc = cl.GetCCList().split(',') |
| 1527 if options.cc: | 1527 if options.cc: |
| (...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2612 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 2612 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
| 2613 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 2613 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
| 2614 | 2614 |
| 2615 | 2615 |
| 2616 if __name__ == '__main__': | 2616 if __name__ == '__main__': |
| 2617 # These affect sys.stdout so do it outside of main() to simplify mocks in | 2617 # These affect sys.stdout so do it outside of main() to simplify mocks in |
| 2618 # unit testing. | 2618 # unit testing. |
| 2619 fix_encoding.fix_encoding() | 2619 fix_encoding.fix_encoding() |
| 2620 colorama.init() | 2620 colorama.init() |
| 2621 sys.exit(main(sys.argv[1:])) | 2621 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |