OLD | NEW |
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 getpass |
10 import json | 10 import json |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 options.issue, options.patchset, | 154 options.issue, options.patchset, |
155 options.server, options.issue) | 155 options.server, options.issue) |
156 return 1 | 156 return 1 |
157 for patch in patchset.patches: | 157 for patch in patchset.patches: |
158 print(patch) | 158 print(patch) |
159 full_dir = os.path.abspath(options.root_dir) | 159 full_dir = os.path.abspath(options.root_dir) |
160 scm_type = scm.determine_scm(full_dir) | 160 scm_type = scm.determine_scm(full_dir) |
161 if scm_type == 'svn': | 161 if scm_type == 'svn': |
162 scm_obj = checkout.SvnCheckout(full_dir, None, None, None, None) | 162 scm_obj = checkout.SvnCheckout(full_dir, None, None, None, None) |
163 elif scm_type == 'git': | 163 elif scm_type == 'git': |
164 scm_obj = checkout.GitCheckout(full_dir, None, None, None, None, | 164 scm_obj = checkout.GitCheckout( |
165 base_ref=options.base_ref) | 165 full_dir, None, None, None, None, |
| 166 base_ref=options.base_ref, |
| 167 email=properties.get('owner_email', 'chrome-bot@chromium.org'), |
| 168 name=properties.get('owner', 'chrome-bot')) |
166 elif scm_type == None: | 169 elif scm_type == None: |
167 scm_obj = checkout.RawCheckout(full_dir, None, None) | 170 scm_obj = checkout.RawCheckout(full_dir, None, None) |
168 else: | 171 else: |
169 parser.error('Couldn\'t determine the scm') | 172 parser.error('Couldn\'t determine the scm') |
170 | 173 |
171 # TODO(maruel): HACK, remove me. | 174 # TODO(maruel): HACK, remove me. |
172 # When run a build slave, make sure buildbot knows that the checkout was | 175 # When run a build slave, make sure buildbot knows that the checkout was |
173 # modified. | 176 # modified. |
174 if options.root_dir == 'src' and getpass.getuser() == 'chrome-bot': | 177 if options.root_dir == 'src' and getpass.getuser() == 'chrome-bot': |
175 # See sourcedirIsPatched() in: | 178 # See sourcedirIsPatched() in: |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 f, options.revision_mapping) | 216 f, options.revision_mapping) |
214 annotated_gclient.emit_buildprops(revisions) | 217 annotated_gclient.emit_buildprops(revisions) |
215 | 218 |
216 return retcode | 219 return retcode |
217 return 0 | 220 return 0 |
218 | 221 |
219 | 222 |
220 if __name__ == "__main__": | 223 if __name__ == "__main__": |
221 fix_encoding.fix_encoding() | 224 fix_encoding.fix_encoding() |
222 sys.exit(main()) | 225 sys.exit(main()) |
OLD | NEW |