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 import json | 10 import json |
(...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1265 if is_dirty_git_tree('upload'): | 1265 if is_dirty_git_tree('upload'): |
1266 return 1 | 1266 return 1 |
1267 | 1267 |
1268 cl = Changelist() | 1268 cl = Changelist() |
1269 if args: | 1269 if args: |
1270 # TODO(ukai): is it ok for gerrit case? | 1270 # TODO(ukai): is it ok for gerrit case? |
1271 base_branch = args[0] | 1271 base_branch = args[0] |
1272 else: | 1272 else: |
1273 # Default to diffing against common ancestor of upstream branch | 1273 # Default to diffing against common ancestor of upstream branch |
1274 base_branch = RunGit(['merge-base', cl.GetUpstreamBranch(), 'HEAD']).strip() | 1274 base_branch = RunGit(['merge-base', cl.GetUpstreamBranch(), 'HEAD']).strip() |
1275 args = [base_branch] | 1275 args = [base_branch, 'HEAD'] |
1276 | 1276 |
1277 if not options.bypass_hooks: | 1277 if not options.bypass_hooks: |
1278 hook_results = cl.RunHook(committing=False, upstream_branch=base_branch, | 1278 hook_results = cl.RunHook(committing=False, upstream_branch=base_branch, |
1279 may_prompt=not options.force, | 1279 may_prompt=not options.force, |
1280 verbose=options.verbose, | 1280 verbose=options.verbose, |
1281 author=None) | 1281 author=None) |
1282 if not hook_results.should_continue(): | 1282 if not hook_results.should_continue(): |
1283 return 1 | 1283 return 1 |
1284 if not options.reviewers and hook_results.reviewers: | 1284 if not options.reviewers and hook_results.reviewers: |
1285 options.reviewers = hook_results.reviewers | 1285 options.reviewers = hook_results.reviewers |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1883 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 1883 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
1884 | 1884 |
1885 # Not a known command. Default to help. | 1885 # Not a known command. Default to help. |
1886 GenUsage(parser, 'help') | 1886 GenUsage(parser, 'help') |
1887 return CMDhelp(parser, argv) | 1887 return CMDhelp(parser, argv) |
1888 | 1888 |
1889 | 1889 |
1890 if __name__ == '__main__': | 1890 if __name__ == '__main__': |
1891 fix_encoding.fix_encoding() | 1891 fix_encoding.fix_encoding() |
1892 sys.exit(main(sys.argv[1:])) | 1892 sys.exit(main(sys.argv[1:])) |
OLD | NEW |