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 1995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2006 # projects that have their source spread across multiple repos. | 2006 # projects that have their source spread across multiple repos. |
2007 remote_url = self.GetGitBaseUrlFromConfig() | 2007 remote_url = self.GetGitBaseUrlFromConfig() |
2008 if not remote_url: | 2008 if not remote_url: |
2009 if settings.GetIsGitSvn(): | 2009 if settings.GetIsGitSvn(): |
2010 remote_url = self.GetGitSvnRemoteUrl() | 2010 remote_url = self.GetGitSvnRemoteUrl() |
2011 else: | 2011 else: |
2012 if self.GetRemoteUrl() and '/' in self.GetUpstreamBranch(): | 2012 if self.GetRemoteUrl() and '/' in self.GetUpstreamBranch(): |
2013 remote_url = '%s@%s' % (self.GetRemoteUrl(), | 2013 remote_url = '%s@%s' % (self.GetRemoteUrl(), |
2014 self.GetUpstreamBranch().split('/')[-1]) | 2014 self.GetUpstreamBranch().split('/')[-1]) |
2015 if remote_url: | 2015 if remote_url: |
2016 upload_args.extend(['--base_url', remote_url]) | |
2017 remote, remote_branch = self.GetRemoteBranch() | 2016 remote, remote_branch = self.GetRemoteBranch() |
2018 target_ref = GetTargetRef(remote, remote_branch, options.target_branch, | 2017 target_ref = GetTargetRef(remote, remote_branch, options.target_branch, |
2019 settings.GetPendingRefPrefix()) | 2018 settings.GetPendingRefPrefix()) |
2020 if target_ref: | 2019 if target_ref: |
2021 upload_args.extend(['--target_ref', target_ref]) | 2020 upload_args.extend(['--target_ref', target_ref]) |
2022 | 2021 |
2023 # Look for dependent patchsets. See crbug.com/480453 for more details. | 2022 # Look for dependent patchsets. See crbug.com/480453 for more details. |
2024 remote, upstream_branch = self.FetchUpstreamTuple(self.GetBranch()) | 2023 remote, upstream_branch = self.FetchUpstreamTuple(self.GetBranch()) |
2025 upstream_branch = ShortBranchName(upstream_branch) | 2024 upstream_branch = ShortBranchName(upstream_branch) |
2026 if remote is '.': | 2025 if remote is '.': |
(...skipping 3191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5218 if __name__ == '__main__': | 5217 if __name__ == '__main__': |
5219 # These affect sys.stdout so do it outside of main() to simplify mocks in | 5218 # These affect sys.stdout so do it outside of main() to simplify mocks in |
5220 # unit testing. | 5219 # unit testing. |
5221 fix_encoding.fix_encoding() | 5220 fix_encoding.fix_encoding() |
5222 setup_color.init() | 5221 setup_color.init() |
5223 try: | 5222 try: |
5224 sys.exit(main(sys.argv[1:])) | 5223 sys.exit(main(sys.argv[1:])) |
5225 except KeyboardInterrupt: | 5224 except KeyboardInterrupt: |
5226 sys.stderr.write('interrupted\n') | 5225 sys.stderr.write('interrupted\n') |
5227 sys.exit(1) | 5226 sys.exit(1) |
OLD | NEW |