| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 errno | 10 import errno |
| (...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 issue = ConvertToInteger(cl.GetIssue()) | 830 issue = ConvertToInteger(cl.GetIssue()) |
| 831 patchset = ConvertToInteger(cl.GetPatchset()) | 831 patchset = ConvertToInteger(cl.GetPatchset()) |
| 832 if issue: | 832 if issue: |
| 833 description = cl.GetDescription() | 833 description = cl.GetDescription() |
| 834 else: | 834 else: |
| 835 # If the change was never uploaded, use the log messages of all commits | 835 # If the change was never uploaded, use the log messages of all commits |
| 836 # up to the branch point, as git cl upload will prefill the description | 836 # up to the branch point, as git cl upload will prefill the description |
| 837 # with these log messages. | 837 # with these log messages. |
| 838 description = RunCommand(['git', 'log', '--pretty=format:%s%n%n%b', | 838 description = RunCommand(['git', 'log', '--pretty=format:%s%n%n%b', |
| 839 '%s...' % (upstream_branch)]).strip() | 839 '%s...' % (upstream_branch)]).strip() |
| 840 change = presubmit_support.GitChange(name, description, absroot, files, | 840 change = presubmit_support.GitChange( |
| 841 issue, patchset) | 841 name, |
| 842 description, |
| 843 absroot, |
| 844 files, |
| 845 issue, |
| 846 patchset, |
| 847 None) |
| 842 | 848 |
| 843 # Apply watchlists on upload. | 849 # Apply watchlists on upload. |
| 844 if not committing: | 850 if not committing: |
| 845 watchlist = watchlists.Watchlists(change.RepositoryRoot()) | 851 watchlist = watchlists.Watchlists(change.RepositoryRoot()) |
| 846 files = [f.LocalPath() for f in change.AffectedFiles()] | 852 files = [f.LocalPath() for f in change.AffectedFiles()] |
| 847 cl.SetWatchers(watchlist.GetWatchersForPaths(files)) | 853 cl.SetWatchers(watchlist.GetWatchersForPaths(files)) |
| 848 | 854 |
| 849 try: | 855 try: |
| 850 output = presubmit_support.DoPresubmitChecks(change, committing, | 856 output = presubmit_support.DoPresubmitChecks(change, committing, |
| 851 verbose=verbose, output_stream=sys.stdout, input_stream=sys.stdin, | 857 verbose=verbose, output_stream=sys.stdout, input_stream=sys.stdin, |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1445 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 1451 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
| 1446 | 1452 |
| 1447 # Not a known command. Default to help. | 1453 # Not a known command. Default to help. |
| 1448 GenUsage(parser, 'help') | 1454 GenUsage(parser, 'help') |
| 1449 return CMDhelp(parser, argv) | 1455 return CMDhelp(parser, argv) |
| 1450 | 1456 |
| 1451 | 1457 |
| 1452 if __name__ == '__main__': | 1458 if __name__ == '__main__': |
| 1453 fix_encoding.fix_encoding() | 1459 fix_encoding.fix_encoding() |
| 1454 sys.exit(main(sys.argv[1:])) | 1460 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |