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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 # Apply watchlists on upload. | 541 # Apply watchlists on upload. |
542 if not committing: | 542 if not committing: |
543 watchlist = watchlists.Watchlists(change.RepositoryRoot()) | 543 watchlist = watchlists.Watchlists(change.RepositoryRoot()) |
544 files = [f.LocalPath() for f in change.AffectedFiles()] | 544 files = [f.LocalPath() for f in change.AffectedFiles()] |
545 self.SetWatchers(watchlist.GetWatchersForPaths(files)) | 545 self.SetWatchers(watchlist.GetWatchersForPaths(files)) |
546 | 546 |
547 try: | 547 try: |
548 output = presubmit_support.DoPresubmitChecks(change, committing, | 548 output = presubmit_support.DoPresubmitChecks(change, committing, |
549 verbose=verbose, output_stream=sys.stdout, input_stream=sys.stdin, | 549 verbose=verbose, output_stream=sys.stdout, input_stream=sys.stdin, |
550 default_presubmit=None, may_prompt=may_prompt, tbr=tbr, | 550 default_presubmit=None, may_prompt=may_prompt, tbr=tbr, |
551 rietveld=self.RpcServer()) | 551 rietveld_obj=self.RpcServer()) |
552 except presubmit_support.PresubmitFailure, e: | 552 except presubmit_support.PresubmitFailure, e: |
553 DieWithError( | 553 DieWithError( |
554 ('%s\nMaybe your depot_tools is out of date?\n' | 554 ('%s\nMaybe your depot_tools is out of date?\n' |
555 'If all fails, contact maruel@') % e) | 555 'If all fails, contact maruel@') % e) |
556 | 556 |
557 # TODO(dpranke): We should propagate the error out instead of calling | 557 # TODO(dpranke): We should propagate the error out instead of calling |
558 # exit(). | 558 # exit(). |
559 if not output.should_continue(): | 559 if not output.should_continue(): |
560 sys.exit(1) | 560 sys.exit(1) |
561 | 561 |
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1471 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 1471 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
1472 | 1472 |
1473 # Not a known command. Default to help. | 1473 # Not a known command. Default to help. |
1474 GenUsage(parser, 'help') | 1474 GenUsage(parser, 'help') |
1475 return CMDhelp(parser, argv) | 1475 return CMDhelp(parser, argv) |
1476 | 1476 |
1477 | 1477 |
1478 if __name__ == '__main__': | 1478 if __name__ == '__main__': |
1479 fix_encoding.fix_encoding() | 1479 fix_encoding.fix_encoding() |
1480 sys.exit(main(sys.argv[1:])) | 1480 sys.exit(main(sys.argv[1:])) |
OLD | NEW |