| 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 2184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2195 branch_cl = Changelist(branchref=local_branch, auth_config=auth_config) | 2195 branch_cl = Changelist(branchref=local_branch, auth_config=auth_config) |
| 2196 branch_cl_issue_url = branch_cl.GetIssueURL() | 2196 branch_cl_issue_url = branch_cl.GetIssueURL() |
| 2197 branch_cl_issue = branch_cl.GetIssue() | 2197 branch_cl_issue = branch_cl.GetIssue() |
| 2198 branch_cl_patchset = branch_cl.GetPatchset() | 2198 branch_cl_patchset = branch_cl.GetPatchset() |
| 2199 if branch_cl_issue_url and branch_cl_issue and branch_cl_patchset: | 2199 if branch_cl_issue_url and branch_cl_issue and branch_cl_patchset: |
| 2200 upload_args.extend( | 2200 upload_args.extend( |
| 2201 ['--depends_on_patchset', '%s:%s' % ( | 2201 ['--depends_on_patchset', '%s:%s' % ( |
| 2202 branch_cl_issue, branch_cl_patchset)]) | 2202 branch_cl_issue, branch_cl_patchset)]) |
| 2203 print | 2203 print |
| 2204 print ('The current branch (%s) is tracking a local branch (%s) with ' | 2204 print ('The current branch (%s) is tracking a local branch (%s) with ' |
| 2205 'an open CL.') % (cl.GetBranch(), local_branch) | 2205 'an associated CL.') % (cl.GetBranch(), local_branch) |
| 2206 print 'Adding %s/#ps%s as a dependency patchset.' % ( | 2206 print 'Adding %s/#ps%s as a dependency patchset.' % ( |
| 2207 branch_cl_issue_url, branch_cl_patchset) | 2207 branch_cl_issue_url, branch_cl_patchset) |
| 2208 print | 2208 print |
| 2209 | 2209 |
| 2210 project = settings.GetProject() | 2210 project = settings.GetProject() |
| 2211 if project: | 2211 if project: |
| 2212 upload_args.extend(['--project', project]) | 2212 upload_args.extend(['--project', project]) |
| 2213 | 2213 |
| 2214 if options.cq_dry_run: | 2214 if options.cq_dry_run: |
| 2215 upload_args.extend(['--cq_dry_run']) | 2215 upload_args.extend(['--cq_dry_run']) |
| (...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3530 if __name__ == '__main__': | 3530 if __name__ == '__main__': |
| 3531 # These affect sys.stdout so do it outside of main() to simplify mocks in | 3531 # These affect sys.stdout so do it outside of main() to simplify mocks in |
| 3532 # unit testing. | 3532 # unit testing. |
| 3533 fix_encoding.fix_encoding() | 3533 fix_encoding.fix_encoding() |
| 3534 colorama.init() | 3534 colorama.init() |
| 3535 try: | 3535 try: |
| 3536 sys.exit(main(sys.argv[1:])) | 3536 sys.exit(main(sys.argv[1:])) |
| 3537 except KeyboardInterrupt: | 3537 except KeyboardInterrupt: |
| 3538 sys.stderr.write('interrupted\n') | 3538 sys.stderr.write('interrupted\n') |
| 3539 sys.exit(1) | 3539 sys.exit(1) |
| OLD | NEW |