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 comment = "Committed manually as r%s" % revision | 1498 props = cl.RpcServer().get_issue_properties(cl.GetIssue()) |
| 1499 patch_num = len(props['patchset']) |
| 1500 comment = "Committed patchset #%d manually as r%s" % (patch_num, revision) |
1499 comment += ' (presubmit successful).' if not options.bypass_hooks else '.' | 1501 comment += ' (presubmit successful).' if not options.bypass_hooks else '.' |
1500 cl.RpcServer().add_comment(cl.GetIssue(), comment) | 1502 cl.RpcServer().add_comment(cl.GetIssue(), comment) |
1501 cl.SetIssue(0) | 1503 cl.SetIssue(0) |
1502 | 1504 |
1503 if retcode == 0: | 1505 if retcode == 0: |
1504 hook = POSTUPSTREAM_HOOK_PATTERN % cmd | 1506 hook = POSTUPSTREAM_HOOK_PATTERN % cmd |
1505 if os.path.isfile(hook): | 1507 if os.path.isfile(hook): |
1506 RunCommand([hook, base_branch], error_ok=True) | 1508 RunCommand([hook, base_branch], error_ok=True) |
1507 | 1509 |
1508 return 0 | 1510 return 0 |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1869 '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))) |
1870 | 1872 |
1871 # Not a known command. Default to help. | 1873 # Not a known command. Default to help. |
1872 GenUsage(parser, 'help') | 1874 GenUsage(parser, 'help') |
1873 return CMDhelp(parser, argv) | 1875 return CMDhelp(parser, argv) |
1874 | 1876 |
1875 | 1877 |
1876 if __name__ == '__main__': | 1878 if __name__ == '__main__': |
1877 fix_encoding.fix_encoding() | 1879 fix_encoding.fix_encoding() |
1878 sys.exit(main(sys.argv[1:])) | 1880 sys.exit(main(sys.argv[1:])) |
OLD | NEW |