| 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 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1247 'GitClHooksBypassedCommit', | 1247 'GitClHooksBypassedCommit', |
| 1248 'Issue %s/%s bypassed hook when committing' % | 1248 'Issue %s/%s bypassed hook when committing' % |
| 1249 (cl.GetRietveldServer(), cl.GetIssue()), | 1249 (cl.GetRietveldServer(), cl.GetIssue()), |
| 1250 verbose=False) | 1250 verbose=False) |
| 1251 | 1251 |
| 1252 description = options.message | 1252 description = options.message |
| 1253 if not description and cl.GetIssue(): | 1253 if not description and cl.GetIssue(): |
| 1254 description = cl.GetDescription() | 1254 description = cl.GetDescription() |
| 1255 | 1255 |
| 1256 if not description: | 1256 if not description: |
| 1257 print 'No description set.' | 1257 if not cl.GetIssue() and options.bypass_hooks: |
| 1258 print 'Visit %s/edit to set it.' % (cl.GetIssueURL()) | 1258 description = CreateDescriptionFromLog([base_branch]) |
| 1259 return 1 | 1259 else: |
| 1260 print 'No description set.' |
| 1261 print 'Visit %s/edit to set it.' % (cl.GetIssueURL()) |
| 1262 return 1 |
| 1260 | 1263 |
| 1261 if cl.GetIssue(): | 1264 if cl.GetIssue(): |
| 1262 description += "\n\nReview URL: %s" % cl.GetIssueURL() | 1265 description += "\n\nReview URL: %s" % cl.GetIssueURL() |
| 1263 | 1266 |
| 1264 if options.contributor: | 1267 if options.contributor: |
| 1265 description += "\nPatch from %s." % options.contributor | 1268 description += "\nPatch from %s." % options.contributor |
| 1266 print 'Description:', repr(description) | 1269 print 'Description:', repr(description) |
| 1267 | 1270 |
| 1268 branches = [base_branch, cl.GetBranchRef()] | 1271 branches = [base_branch, cl.GetBranchRef()] |
| 1269 if not options.force: | 1272 if not options.force: |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1611 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 1614 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
| 1612 | 1615 |
| 1613 # Not a known command. Default to help. | 1616 # Not a known command. Default to help. |
| 1614 GenUsage(parser, 'help') | 1617 GenUsage(parser, 'help') |
| 1615 return CMDhelp(parser, argv) | 1618 return CMDhelp(parser, argv) |
| 1616 | 1619 |
| 1617 | 1620 |
| 1618 if __name__ == '__main__': | 1621 if __name__ == '__main__': |
| 1619 fix_encoding.fix_encoding() | 1622 fix_encoding.fix_encoding() |
| 1620 sys.exit(main(sys.argv[1:])) | 1623 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |