Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: apply_issue.py

Issue 10391033: Improve error message in patch application failure. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | checkout.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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())
OLDNEW
« no previous file with comments | « no previous file | checkout.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698