| 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 2297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2308 @subcommand.usage('[new upstream branch]') | 2308 @subcommand.usage('[new upstream branch]') |
| 2309 def CMDupstream(parser, args): | 2309 def CMDupstream(parser, args): |
| 2310 """Prints or sets the name of the upstream branch, if any.""" | 2310 """Prints or sets the name of the upstream branch, if any.""" |
| 2311 _, args = parser.parse_args(args) | 2311 _, args = parser.parse_args(args) |
| 2312 if len(args) > 1: | 2312 if len(args) > 1: |
| 2313 parser.error('Unrecognized args: %s' % ' '.join(args)) | 2313 parser.error('Unrecognized args: %s' % ' '.join(args)) |
| 2314 | 2314 |
| 2315 cl = Changelist() | 2315 cl = Changelist() |
| 2316 if args: | 2316 if args: |
| 2317 # One arg means set upstream branch. | 2317 # One arg means set upstream branch. |
| 2318 RunGit(['branch', '--set-upstream', cl.GetBranch(), args[0]]) | 2318 branch = cl.GetBranch() |
| 2319 RunGit(['branch', '--set-upstream', branch, args[0]]) |
| 2319 cl = Changelist() | 2320 cl = Changelist() |
| 2320 print "Upstream branch set to " + cl.GetUpstreamBranch() | 2321 print "Upstream branch set to " + cl.GetUpstreamBranch() |
| 2322 |
| 2323 # Clear configured merge-base, if there is one. |
| 2324 git_common.remove_merge_base(branch) |
| 2321 else: | 2325 else: |
| 2322 print cl.GetUpstreamBranch() | 2326 print cl.GetUpstreamBranch() |
| 2323 return 0 | 2327 return 0 |
| 2324 | 2328 |
| 2325 | 2329 |
| 2326 def CMDweb(parser, args): | 2330 def CMDweb(parser, args): |
| 2327 """Opens the current CL in the web browser.""" | 2331 """Opens the current CL in the web browser.""" |
| 2328 _, args = parser.parse_args(args) | 2332 _, args = parser.parse_args(args) |
| 2329 if args: | 2333 if args: |
| 2330 parser.error('Unrecognized args: %s' % ' '.join(args)) | 2334 parser.error('Unrecognized args: %s' % ' '.join(args)) |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2557 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 2561 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
| 2558 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 2562 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
| 2559 | 2563 |
| 2560 | 2564 |
| 2561 if __name__ == '__main__': | 2565 if __name__ == '__main__': |
| 2562 # These affect sys.stdout so do it outside of main() to simplify mocks in | 2566 # These affect sys.stdout so do it outside of main() to simplify mocks in |
| 2563 # unit testing. | 2567 # unit testing. |
| 2564 fix_encoding.fix_encoding() | 2568 fix_encoding.fix_encoding() |
| 2565 colorama.init() | 2569 colorama.init() |
| 2566 sys.exit(main(sys.argv[1:])) | 2570 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |