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

Side by Side Diff: apply_issue.py

Issue 10905160: Ensure buildbot knows that the checkout was patched when patching. (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 getpass
9 import logging 10 import logging
10 import optparse 11 import optparse
11 import os 12 import os
12 import sys 13 import sys
13 import urllib2 14 import urllib2
14 15
15 import breakpad # pylint: disable=W0611 16 import breakpad # pylint: disable=W0611
16 17
17 import checkout 18 import checkout
18 import fix_encoding 19 import fix_encoding
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 scm_type = scm.determine_scm(options.root_dir) 87 scm_type = scm.determine_scm(options.root_dir)
87 if scm_type == 'svn': 88 if scm_type == 'svn':
88 scm_obj = checkout.SvnCheckout(options.root_dir, None, None, None, None) 89 scm_obj = checkout.SvnCheckout(options.root_dir, None, None, None, None)
89 elif scm_type == 'git': 90 elif scm_type == 'git':
90 scm_obj = checkout.GitCheckoutBase(options.root_dir, None, None) 91 scm_obj = checkout.GitCheckoutBase(options.root_dir, None, None)
91 elif scm_type == None: 92 elif scm_type == None:
92 scm_obj = checkout.RawCheckout(options.root_dir, None, None) 93 scm_obj = checkout.RawCheckout(options.root_dir, None, None)
93 else: 94 else:
94 parser.error('Couldn\'t determine the scm') 95 parser.error('Couldn\'t determine the scm')
95 96
97 # TODO(maruel): HACK, remove me.
98 if options.root_dir == 'src' and getpass.getuser() == 'chrome-bot':
99 # See sourcedirIsPatched() in:
100 # http://src.chromium.org/viewvc/chrome/trunk/tools/build/scripts/slave/
101 # chromium_commands.py?view=markup
102 open('.buildbot-patched', 'w').close()
M-A Ruel 2012/09/07 20:47:48 In this case, the current working directory is the
103
96 # Apply the patch. 104 # Apply the patch.
97 try: 105 try:
98 scm_obj.apply_patch(patchset) 106 scm_obj.apply_patch(patchset)
99 except checkout.PatchApplicationFailed, e: 107 except checkout.PatchApplicationFailed, e:
100 print >> sys.stderr, str(e) 108 print >> sys.stderr, str(e)
101 return 1 109 return 1
102 return 0 110 return 0
103 111
104 112
105 if __name__ == "__main__": 113 if __name__ == "__main__":
106 fix_encoding.fix_encoding() 114 fix_encoding.fix_encoding()
107 sys.exit(main()) 115 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