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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 print('Checkout path=%s' % scm_obj.project_path) | 228 print('Checkout path=%s' % scm_obj.project_path) |
229 return 1 | 229 return 1 |
230 | 230 |
231 if ('DEPS' in map(os.path.basename, patchset.filenames) | 231 if ('DEPS' in map(os.path.basename, patchset.filenames) |
232 and not options.ignore_deps): | 232 and not options.ignore_deps): |
233 gclient_root = gclient_utils.FindGclientRoot(full_dir) | 233 gclient_root = gclient_utils.FindGclientRoot(full_dir) |
234 if gclient_root and scm_type: | 234 if gclient_root and scm_type: |
235 print( | 235 print( |
236 'A DEPS file was updated inside a gclient checkout, running gclient ' | 236 'A DEPS file was updated inside a gclient checkout, running gclient ' |
237 'sync.') | 237 'sync.') |
238 base_rev = 'BASE' if scm_type == 'svn' else 'HEAD' | |
239 gclient_path = os.path.join(BASE_DIR, 'gclient') | 238 gclient_path = os.path.join(BASE_DIR, 'gclient') |
240 if sys.platform == 'win32': | 239 if sys.platform == 'win32': |
241 gclient_path += '.bat' | 240 gclient_path += '.bat' |
242 with annotated_gclient.temp_filename(suffix='gclient') as f: | 241 with annotated_gclient.temp_filename(suffix='gclient') as f: |
243 cmd = [ | 242 cmd = [ |
244 gclient_path, 'sync', | 243 gclient_path, 'sync', |
245 '--revision', base_rev, | |
246 '--nohooks', | 244 '--nohooks', |
247 '--delete_unversioned_trees', | 245 '--delete_unversioned_trees', |
248 ] | 246 ] |
| 247 if scm_type == 'svn': |
| 248 cmd.extend(['--revision', 'BASE']) |
249 if options.revision_mapping: | 249 if options.revision_mapping: |
250 cmd.extend(['--output-json', f]) | 250 cmd.extend(['--output-json', f]) |
251 | 251 |
252 retcode = subprocess.call(cmd, cwd=gclient_root) | 252 retcode = subprocess.call(cmd, cwd=gclient_root) |
253 | 253 |
254 if retcode == 0 and options.revision_mapping: | 254 if retcode == 0 and options.revision_mapping: |
255 revisions = annotated_gclient.parse_got_revision( | 255 revisions = annotated_gclient.parse_got_revision( |
256 f, options.revision_mapping) | 256 f, options.revision_mapping) |
257 annotated_gclient.emit_buildprops(revisions) | 257 annotated_gclient.emit_buildprops(revisions) |
258 | 258 |
259 return retcode | 259 return retcode |
260 return 0 | 260 return 0 |
261 | 261 |
262 | 262 |
263 if __name__ == "__main__": | 263 if __name__ == "__main__": |
264 fix_encoding.fix_encoding() | 264 fix_encoding.fix_encoding() |
265 sys.exit(main()) | 265 sys.exit(main()) |
OLD | NEW |