| 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 """Applies an issue from Rietveld. | 6 """Applies an issue from Rietveld. |
| 7 """ | 7 """ |
| 8 | 8 |
| 9 import logging | 9 import logging |
| 10 import optparse | 10 import optparse |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 if scm_type == 'svn': | 62 if scm_type == 'svn': |
| 63 scm_obj = checkout.SvnCheckout(options.root_dir, None, None, None, None) | 63 scm_obj = checkout.SvnCheckout(options.root_dir, None, None, None, None) |
| 64 elif scm_type == 'git': | 64 elif scm_type == 'git': |
| 65 scm_obj = checkout.GitCheckoutBase(options.root_dir, None, None) | 65 scm_obj = checkout.GitCheckoutBase(options.root_dir, None, None) |
| 66 elif scm_type == None: | 66 elif scm_type == None: |
| 67 scm_obj = checkout.RawCheckout(options.root_dir, None) | 67 scm_obj = checkout.RawCheckout(options.root_dir, None) |
| 68 else: | 68 else: |
| 69 parser.error('Couldn\'t determine the scm') | 69 parser.error('Couldn\'t determine the scm') |
| 70 | 70 |
| 71 # Apply the patch. | 71 # Apply the patch. |
| 72 scm_obj.apply_patch(patchset) | 72 try: |
| 73 scm_obj.apply_patch(patchset) |
| 74 except checkout.PatchApplicationFailed, e: |
| 75 print >> sys.stderr, str(e) |
| 76 return 1 |
| 73 return 0 | 77 return 0 |
| 74 | 78 |
| 75 | 79 |
| 76 if __name__ == "__main__": | 80 if __name__ == "__main__": |
| 77 fix_encoding.fix_encoding() | 81 fix_encoding.fix_encoding() |
| 78 sys.exit(main()) | 82 sys.exit(main()) |
| OLD | NEW |