| 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 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1337 match = filter(None, match) | 1337 match = filter(None, match) |
| 1338 if len(match) != 1: | 1338 if len(match) != 1: |
| 1339 DieWithError("Couldn't parse ouput to extract the committed hash:\n%s" % | 1339 DieWithError("Couldn't parse ouput to extract the committed hash:\n%s" % |
| 1340 output) | 1340 output) |
| 1341 revision = match[0].group(2) | 1341 revision = match[0].group(2) |
| 1342 else: | 1342 else: |
| 1343 return 1 | 1343 return 1 |
| 1344 viewvc_url = settings.GetViewVCUrl() | 1344 viewvc_url = settings.GetViewVCUrl() |
| 1345 if viewvc_url and revision: | 1345 if viewvc_url and revision: |
| 1346 cl.description += ('\n\nCommitted: ' + viewvc_url + revision) | 1346 cl.description += ('\n\nCommitted: ' + viewvc_url + revision) |
| 1347 elif revision: |
| 1348 cl.description += ('\n\nCommitted: ' + revision) |
| 1347 print ('Closing issue ' | 1349 print ('Closing issue ' |
| 1348 '(you may be prompted for your codereview password)...') | 1350 '(you may be prompted for your codereview password)...') |
| 1349 cl.CloseIssue() | 1351 cl.CloseIssue() |
| 1350 cl.SetIssue(0) | 1352 cl.SetIssue(0) |
| 1351 | 1353 |
| 1352 if retcode == 0: | 1354 if retcode == 0: |
| 1353 hook = POSTUPSTREAM_HOOK_PATTERN % cmd | 1355 hook = POSTUPSTREAM_HOOK_PATTERN % cmd |
| 1354 if os.path.isfile(hook): | 1356 if os.path.isfile(hook): |
| 1355 RunCommand([hook, base_branch], error_ok=True) | 1357 RunCommand([hook, base_branch], error_ok=True) |
| 1356 | 1358 |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1716 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 1718 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
| 1717 | 1719 |
| 1718 # Not a known command. Default to help. | 1720 # Not a known command. Default to help. |
| 1719 GenUsage(parser, 'help') | 1721 GenUsage(parser, 'help') |
| 1720 return CMDhelp(parser, argv) | 1722 return CMDhelp(parser, argv) |
| 1721 | 1723 |
| 1722 | 1724 |
| 1723 if __name__ == '__main__': | 1725 if __name__ == '__main__': |
| 1724 fix_encoding.fix_encoding() | 1726 fix_encoding.fix_encoding() |
| 1725 sys.exit(main(sys.argv[1:])) | 1727 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |