| 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 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1488 else: | 1488 else: |
| 1489 return 1 | 1489 return 1 |
| 1490 viewvc_url = settings.GetViewVCUrl() | 1490 viewvc_url = settings.GetViewVCUrl() |
| 1491 if viewvc_url and revision: | 1491 if viewvc_url and revision: |
| 1492 cl.description += ('\n\nCommitted: ' + viewvc_url + revision) | 1492 cl.description += ('\n\nCommitted: ' + viewvc_url + revision) |
| 1493 elif revision: | 1493 elif revision: |
| 1494 cl.description += ('\n\nCommitted: ' + revision) | 1494 cl.description += ('\n\nCommitted: ' + revision) |
| 1495 print ('Closing issue ' | 1495 print ('Closing issue ' |
| 1496 '(you may be prompted for your codereview password)...') | 1496 '(you may be prompted for your codereview password)...') |
| 1497 cl.CloseIssue() | 1497 cl.CloseIssue() |
| 1498 props = cl.RpcServer().get_issue_properties(cl.GetIssue()) | 1498 props = cl.RpcServer().get_issue_properties(cl.GetIssue(), False) |
| 1499 patch_num = len(props['patchset']) | 1499 patch_num = len(props['patchset']) |
| 1500 comment = "Committed patchset #%d manually as r%s" % (patch_num, revision) | 1500 comment = "Committed patchset #%d manually as r%s" % (patch_num, revision) |
| 1501 comment += ' (presubmit successful).' if not options.bypass_hooks else '.' | 1501 comment += ' (presubmit successful).' if not options.bypass_hooks else '.' |
| 1502 cl.RpcServer().add_comment(cl.GetIssue(), comment) | 1502 cl.RpcServer().add_comment(cl.GetIssue(), comment) |
| 1503 cl.SetIssue(0) | 1503 cl.SetIssue(0) |
| 1504 | 1504 |
| 1505 if retcode == 0: | 1505 if retcode == 0: |
| 1506 hook = POSTUPSTREAM_HOOK_PATTERN % cmd | 1506 hook = POSTUPSTREAM_HOOK_PATTERN % cmd |
| 1507 if os.path.isfile(hook): | 1507 if os.path.isfile(hook): |
| 1508 RunCommand([hook, base_branch], error_ok=True) | 1508 RunCommand([hook, base_branch], error_ok=True) |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1871 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 1871 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
| 1872 | 1872 |
| 1873 # Not a known command. Default to help. | 1873 # Not a known command. Default to help. |
| 1874 GenUsage(parser, 'help') | 1874 GenUsage(parser, 'help') |
| 1875 return CMDhelp(parser, argv) | 1875 return CMDhelp(parser, argv) |
| 1876 | 1876 |
| 1877 | 1877 |
| 1878 if __name__ == '__main__': | 1878 if __name__ == '__main__': |
| 1879 fix_encoding.fix_encoding() | 1879 fix_encoding.fix_encoding() |
| 1880 sys.exit(main(sys.argv[1:])) | 1880 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |