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

Side by Side Diff: apply_issue.py

Issue 10900029: Due to a temporary bug in the try server, ignore '=' as an email address. (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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 options, args = parser.parse_args() 45 options, args = parser.parse_args()
46 logging.basicConfig( 46 logging.basicConfig(
47 format='%(levelname)5s %(module)11s(%(lineno)4d): %(message)s', 47 format='%(levelname)5s %(module)11s(%(lineno)4d): %(message)s',
48 level=[logging.WARNING, logging.INFO, logging.DEBUG][ 48 level=[logging.WARNING, logging.INFO, logging.DEBUG][
49 min(2, options.verbose)]) 49 min(2, options.verbose)])
50 if args: 50 if args:
51 parser.error('Extra argument(s) "%s" not understood' % ' '.join(args)) 51 parser.error('Extra argument(s) "%s" not understood' % ' '.join(args))
52 if not options.issue: 52 if not options.issue:
53 parser.error('Require --issue') 53 parser.error('Require --issue')
54 54
55 # TODO(rogerta): Remove me, it's ugly.
56 if options.email == '=':
57 options.email = ''
58
55 obj = rietveld.Rietveld(options.server, options.email, None) 59 obj = rietveld.Rietveld(options.server, options.email, None)
56 60
57 if not options.patchset: 61 if not options.patchset:
58 options.patchset = obj.get_issue_properties( 62 options.patchset = obj.get_issue_properties(
59 options.issue, False)['patchsets'][-1] 63 options.issue, False)['patchsets'][-1]
60 logging.info('Using patchset %d' % options.patchset) 64 logging.info('Using patchset %d' % options.patchset)
61 # Download the patch. 65 # Download the patch.
62 patchset = obj.get_patch(options.issue, options.patchset) 66 patchset = obj.get_patch(options.issue, options.patchset)
63 for patch in patchset.patches: 67 for patch in patchset.patches:
64 logging.info(patch) 68 logging.info(patch)
(...skipping 12 matching lines...) Expand all
77 scm_obj.apply_patch(patchset) 81 scm_obj.apply_patch(patchset)
78 except checkout.PatchApplicationFailed, e: 82 except checkout.PatchApplicationFailed, e:
79 print >> sys.stderr, str(e) 83 print >> sys.stderr, str(e)
80 return 1 84 return 1
81 return 0 85 return 0
82 86
83 87
84 if __name__ == "__main__": 88 if __name__ == "__main__":
85 fix_encoding.fix_encoding() 89 fix_encoding.fix_encoding()
86 sys.exit(main()) 90 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