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

Side by Side Diff: apply_issue.py

Issue 10889037: Add outputs to apply_issue.py (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 8 years, 3 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 | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 # TODO(rogerta): Remove me, it's ugly. 55 # TODO(rogerta): Remove me, it's ugly.
56 if options.email == '=': 56 if options.email == '=':
57 options.email = '' 57 options.email = ''
58 58
59 obj = rietveld.Rietveld(options.server, options.email, None) 59 obj = rietveld.Rietveld(options.server, options.email, None)
60 60
61 if not options.patchset: 61 if not options.patchset:
62 options.patchset = obj.get_issue_properties( 62 options.patchset = obj.get_issue_properties(
63 options.issue, False)['patchsets'][-1] 63 options.issue, False)['patchsets'][-1]
64 logging.info('Using patchset %d' % options.patchset) 64 print('No patchset specified. Using patchset %d' % options.patchset)
65 # Download the patch. 65
66 print('Downloading the patch.')
66 patchset = obj.get_patch(options.issue, options.patchset) 67 patchset = obj.get_patch(options.issue, options.patchset)
67 for patch in patchset.patches: 68 for patch in patchset.patches:
68 logging.info(patch) 69 print(patch)
69 scm_type = scm.determine_scm(options.root_dir) 70 scm_type = scm.determine_scm(options.root_dir)
70 if scm_type == 'svn': 71 if scm_type == 'svn':
71 scm_obj = checkout.SvnCheckout(options.root_dir, None, None, None, None) 72 scm_obj = checkout.SvnCheckout(options.root_dir, None, None, None, None)
72 elif scm_type == 'git': 73 elif scm_type == 'git':
73 scm_obj = checkout.GitCheckoutBase(options.root_dir, None, None) 74 scm_obj = checkout.GitCheckoutBase(options.root_dir, None, None)
74 elif scm_type == None: 75 elif scm_type == None:
75 scm_obj = checkout.RawCheckout(options.root_dir, None) 76 scm_obj = checkout.RawCheckout(options.root_dir, None)
76 else: 77 else:
77 parser.error('Couldn\'t determine the scm') 78 parser.error('Couldn\'t determine the scm')
78 79
79 # Apply the patch. 80 # Apply the patch.
80 try: 81 try:
81 scm_obj.apply_patch(patchset) 82 scm_obj.apply_patch(patchset)
82 except checkout.PatchApplicationFailed, e: 83 except checkout.PatchApplicationFailed, e:
83 print >> sys.stderr, str(e) 84 print >> sys.stderr, str(e)
84 return 1 85 return 1
85 return 0 86 return 0
86 87
87 88
88 if __name__ == "__main__": 89 if __name__ == "__main__":
89 fix_encoding.fix_encoding() 90 fix_encoding.fix_encoding()
90 sys.exit(main()) 91 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698