OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 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 """\ | 6 """\ |
7 Wrapper script around Rietveld's upload.py that simplifies working with groups | 7 Wrapper script around Rietveld's upload.py that simplifies working with groups |
8 of files. | 8 of files. |
9 """ | 9 """ |
10 | 10 |
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 return SVN.GenerateDiff(files, root=root) | 757 return SVN.GenerateDiff(files, root=root) |
758 | 758 |
759 | 759 |
760 def OptionallyDoPresubmitChecks(change_info, committing, args): | 760 def OptionallyDoPresubmitChecks(change_info, committing, args): |
761 if FilterFlag(args, "--no_presubmit") or FilterFlag(args, "--force"): | 761 if FilterFlag(args, "--no_presubmit") or FilterFlag(args, "--force"): |
762 return presubmit_support.PresubmitOutput() | 762 return presubmit_support.PresubmitOutput() |
763 return DoPresubmitChecks(change_info, committing, True) | 763 return DoPresubmitChecks(change_info, committing, True) |
764 | 764 |
765 | 765 |
766 def suggest_reviewers(change_info, affected_files): | 766 def suggest_reviewers(change_info, affected_files): |
767 owners_db = owners.Database(change_info.LocalRoot(), fopen=file, | 767 owners_db = owners.Database(change_info.GetLocalRoot(), fopen=file, |
768 os_path=os.path) | 768 os_path=os.path) |
769 return owners_db.reviewers_for(affected_files) | 769 return owners_db.reviewers_for(affected_files) |
770 | 770 |
771 | 771 |
772 def defer_attributes(a, b): | 772 def defer_attributes(a, b): |
773 """Copy attributes from an object (like a function) to another.""" | 773 """Copy attributes from an object (like a function) to another.""" |
774 for x in dir(a): | 774 for x in dir(a): |
775 if not getattr(b, x, None): | 775 if not getattr(b, x, None): |
776 setattr(b, x, getattr(a, x)) | 776 setattr(b, x, getattr(a, x)) |
777 | 777 |
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1461 if e.code != 500: | 1461 if e.code != 500: |
1462 raise | 1462 raise |
1463 print >> sys.stderr, ( | 1463 print >> sys.stderr, ( |
1464 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 1464 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
1465 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) | 1465 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) |
1466 return 1 | 1466 return 1 |
1467 | 1467 |
1468 | 1468 |
1469 if __name__ == "__main__": | 1469 if __name__ == "__main__": |
1470 sys.exit(main(sys.argv[1:])) | 1470 sys.exit(main(sys.argv[1:])) |
OLD | NEW |