OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Gclient-specific SCM-specific operations.""" | 5 """Gclient-specific SCM-specific operations.""" |
6 | 6 |
7 from __future__ import print_function | 7 from __future__ import print_function |
8 | 8 |
9 import logging | 9 import logging |
10 import os | 10 import os |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 | 351 |
352 if (not os.path.exists(self.checkout_path) or | 352 if (not os.path.exists(self.checkout_path) or |
353 (os.path.isdir(self.checkout_path) and | 353 (os.path.isdir(self.checkout_path) and |
354 not os.path.exists(os.path.join(self.checkout_path, '.git')))): | 354 not os.path.exists(os.path.join(self.checkout_path, '.git')))): |
355 try: | 355 try: |
356 self._Clone(revision, url, options) | 356 self._Clone(revision, url, options) |
357 except subprocess2.CalledProcessError: | 357 except subprocess2.CalledProcessError: |
358 self._DeleteOrMove(options.force) | 358 self._DeleteOrMove(options.force) |
359 self._Clone(revision, url, options) | 359 self._Clone(revision, url, options) |
360 self._UpdateBranchHeads(options, fetch=True) | 360 self._UpdateBranchHeads(options, fetch=True) |
| 361 if deps_revision and deps_revision.startswith('branch-heads/'): |
| 362 deps_branch = deps_revision.replace('branch-heads/', '') |
| 363 self._Capture(['branch', deps_branch, deps_revision]) |
| 364 self._Capture(['checkout', '--quiet', deps_branch]) |
361 if file_list is not None: | 365 if file_list is not None: |
362 files = self._Capture(['ls-files']).splitlines() | 366 files = self._Capture(['ls-files']).splitlines() |
363 file_list.extend([os.path.join(self.checkout_path, f) for f in files]) | 367 file_list.extend([os.path.join(self.checkout_path, f) for f in files]) |
364 if not verbose: | 368 if not verbose: |
365 # Make the output a little prettier. It's nice to have some whitespace | 369 # Make the output a little prettier. It's nice to have some whitespace |
366 # between projects when cloning. | 370 # between projects when cloning. |
367 self.Print('') | 371 self.Print('') |
368 return self._Capture(['rev-parse', '--verify', 'HEAD']) | 372 return self._Capture(['rev-parse', '--verify', 'HEAD']) |
369 | 373 |
370 if not managed: | 374 if not managed: |
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1454 new_command.append('--force') | 1458 new_command.append('--force') |
1455 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1459 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1456 new_command.extend(('--accept', 'theirs-conflict')) | 1460 new_command.extend(('--accept', 'theirs-conflict')) |
1457 elif options.manually_grab_svn_rev: | 1461 elif options.manually_grab_svn_rev: |
1458 new_command.append('--force') | 1462 new_command.append('--force') |
1459 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1463 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1460 new_command.extend(('--accept', 'postpone')) | 1464 new_command.extend(('--accept', 'postpone')) |
1461 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1465 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1462 new_command.extend(('--accept', 'postpone')) | 1466 new_command.extend(('--accept', 'postpone')) |
1463 return new_command | 1467 return new_command |
OLD | NEW |