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

Side by Side Diff: apply_issue.py

Issue 175543006: Pass in "--author 'name <email@somewhere.com>" when doing git patches in apply_issue.py (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Removed unneeded if Created 6 years, 10 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
« 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) 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(full_dir, None, None, None, None,
165 base_ref=options.base_ref) 165 base_ref=options.base_ref,)
166 elif scm_type == None: 166 elif scm_type == None:
167 scm_obj = checkout.RawCheckout(full_dir, None, None) 167 scm_obj = checkout.RawCheckout(full_dir, None, None)
168 else: 168 else:
169 parser.error('Couldn\'t determine the scm') 169 parser.error('Couldn\'t determine the scm')
170 170
171 # TODO(maruel): HACK, remove me. 171 # TODO(maruel): HACK, remove me.
172 # When run a build slave, make sure buildbot knows that the checkout was 172 # When run a build slave, make sure buildbot knows that the checkout was
173 # modified. 173 # modified.
174 if options.root_dir == 'src' and getpass.getuser() == 'chrome-bot': 174 if options.root_dir == 'src' and getpass.getuser() == 'chrome-bot':
175 # See sourcedirIsPatched() in: 175 # See sourcedirIsPatched() in:
176 # http://src.chromium.org/viewvc/chrome/trunk/tools/build/scripts/slave/ 176 # http://src.chromium.org/viewvc/chrome/trunk/tools/build/scripts/slave/
177 # chromium_commands.py?view=markup 177 # chromium_commands.py?view=markup
178 open('.buildbot-patched', 'w').close() 178 open('.buildbot-patched', 'w').close()
179 179
180 print('\nApplying the patch.') 180 print('\nApplying the patch.')
181 try: 181 try:
182 scm_obj.apply_patch(patchset, verbose=True) 182 scm_obj.apply_patch(
183 patchset, verbose=True,
184 email=properties.get('owner_email', 'chrome-bot@chromium.org'),
185 name=properties.get('owner', 'chrome-bot'))
183 except checkout.PatchApplicationFailed, e: 186 except checkout.PatchApplicationFailed, e:
184 print(str(e)) 187 print(str(e))
185 print('CWD=%s' % os.getcwd()) 188 print('CWD=%s' % os.getcwd())
186 print('Checkout path=%s' % scm_obj.project_path) 189 print('Checkout path=%s' % scm_obj.project_path)
187 return 1 190 return 1
188 191
189 if 'DEPS' in map(os.path.basename, patchset.filenames): 192 if 'DEPS' in map(os.path.basename, patchset.filenames):
190 gclient_root = gclient_utils.FindGclientRoot(full_dir) 193 gclient_root = gclient_utils.FindGclientRoot(full_dir)
191 if gclient_root and scm_type: 194 if gclient_root and scm_type:
192 print( 195 print(
(...skipping 20 matching lines...) Expand all
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())
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