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 2456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2467 ask_for_data('About to upload; enter to confirm.') | 2467 ask_for_data('About to upload; enter to confirm.') |
2468 | 2468 |
2469 print_stats(options.similarity, options.find_copies, args) | 2469 print_stats(options.similarity, options.find_copies, args) |
2470 if settings.GetIsGerrit(): | 2470 if settings.GetIsGerrit(): |
2471 if options.squash and options.no_squash: | 2471 if options.squash and options.no_squash: |
2472 DieWithError('Can only use one of --squash or --no-squash') | 2472 DieWithError('Can only use one of --squash or --no-squash') |
2473 | 2473 |
2474 options.squash = ((settings.GetSquashGerritUploads() or options.squash) and | 2474 options.squash = ((settings.GetSquashGerritUploads() or options.squash) and |
2475 not options.no_squash) | 2475 not options.no_squash) |
2476 | 2476 |
2477 return GerritUpload(options, args, cl, change) | 2477 ret = GerritUpload(options, args, cl, change) |
2478 ret = RietveldUpload(options, args, cl, change) | 2478 else: |
| 2479 ret = RietveldUpload(options, args, cl, change) |
2479 if not ret: | 2480 if not ret: |
2480 git_set_branch_value('last-upload-hash', | 2481 git_set_branch_value('last-upload-hash', |
2481 RunGit(['rev-parse', 'HEAD']).strip()) | 2482 RunGit(['rev-parse', 'HEAD']).strip()) |
2482 # Run post upload hooks, if specified. | 2483 # Run post upload hooks, if specified. |
2483 if settings.GetRunPostUploadHook(): | 2484 if settings.GetRunPostUploadHook(): |
2484 presubmit_support.DoPostUploadExecuter( | 2485 presubmit_support.DoPostUploadExecuter( |
2485 change, | 2486 change, |
2486 cl, | 2487 cl, |
2487 settings.GetRoot(), | 2488 settings.GetRoot(), |
2488 options.verbose, | 2489 options.verbose, |
(...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3759 if __name__ == '__main__': | 3760 if __name__ == '__main__': |
3760 # These affect sys.stdout so do it outside of main() to simplify mocks in | 3761 # These affect sys.stdout so do it outside of main() to simplify mocks in |
3761 # unit testing. | 3762 # unit testing. |
3762 fix_encoding.fix_encoding() | 3763 fix_encoding.fix_encoding() |
3763 colorama.init() | 3764 colorama.init() |
3764 try: | 3765 try: |
3765 sys.exit(main(sys.argv[1:])) | 3766 sys.exit(main(sys.argv[1:])) |
3766 except KeyboardInterrupt: | 3767 except KeyboardInterrupt: |
3767 sys.stderr.write('interrupted\n') | 3768 sys.stderr.write('interrupted\n') |
3768 sys.exit(1) | 3769 sys.exit(1) |
OLD | NEW |