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 and Gerrit.""" | 8 """A git-command for integrating reviews on Rietveld and Gerrit.""" |
9 | 9 |
10 from __future__ import print_function | 10 from __future__ import print_function |
(...skipping 3991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4002 # Besides, Gerrit has the ability to change the commit message on submit | 4002 # Besides, Gerrit has the ability to change the commit message on submit |
4003 # automatically, thus there is no need to support this option (so far?). | 4003 # automatically, thus there is no need to support this option (so far?). |
4004 parser.error('-m MESSAGE option is not supported for Gerrit.') | 4004 parser.error('-m MESSAGE option is not supported for Gerrit.') |
4005 if options.contributor: | 4005 if options.contributor: |
4006 parser.error( | 4006 parser.error( |
4007 '-c CONTRIBUTOR option is not supported for Gerrit.\n' | 4007 '-c CONTRIBUTOR option is not supported for Gerrit.\n' |
4008 'Before uploading a commit to Gerrit, ensure it\'s author field is ' | 4008 'Before uploading a commit to Gerrit, ensure it\'s author field is ' |
4009 'the contributor\'s "name <email>". If you can\'t upload such a ' | 4009 'the contributor\'s "name <email>". If you can\'t upload such a ' |
4010 'commit for review, contact your repository admin and request' | 4010 'commit for review, contact your repository admin and request' |
4011 '"Forge-Author" permission.') | 4011 '"Forge-Author" permission.') |
| 4012 if not cl.GetIssue(): |
| 4013 DieWithError('You must upload the issue first to Gerrit.\n' |
| 4014 ' If you would rather have `git cl land` upload ' |
| 4015 'automatically for you, see http://crbug.com/642759') |
4012 return cl._codereview_impl.CMDLand(options.force, options.bypass_hooks, | 4016 return cl._codereview_impl.CMDLand(options.force, options.bypass_hooks, |
4013 options.verbose) | 4017 options.verbose) |
4014 | 4018 |
4015 current = cl.GetBranch() | 4019 current = cl.GetBranch() |
4016 remote, upstream_branch = cl.FetchUpstreamTuple(cl.GetBranch()) | 4020 remote, upstream_branch = cl.FetchUpstreamTuple(cl.GetBranch()) |
4017 if not settings.GetIsGitSvn() and remote == '.': | 4021 if not settings.GetIsGitSvn() and remote == '.': |
4018 print() | 4022 print() |
4019 print('Attempting to push branch %r into another local branch!' % current) | 4023 print('Attempting to push branch %r into another local branch!' % current) |
4020 print() | 4024 print() |
4021 print('Either reparent this branch on top of origin/master:') | 4025 print('Either reparent this branch on top of origin/master:') |
(...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5270 if __name__ == '__main__': | 5274 if __name__ == '__main__': |
5271 # These affect sys.stdout so do it outside of main() to simplify mocks in | 5275 # These affect sys.stdout so do it outside of main() to simplify mocks in |
5272 # unit testing. | 5276 # unit testing. |
5273 fix_encoding.fix_encoding() | 5277 fix_encoding.fix_encoding() |
5274 setup_color.init() | 5278 setup_color.init() |
5275 try: | 5279 try: |
5276 sys.exit(main(sys.argv[1:])) | 5280 sys.exit(main(sys.argv[1:])) |
5277 except KeyboardInterrupt: | 5281 except KeyboardInterrupt: |
5278 sys.stderr.write('interrupted\n') | 5282 sys.stderr.write('interrupted\n') |
5279 sys.exit(1) | 5283 sys.exit(1) |
OLD | NEW |