| 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 import logging | 7 import logging |
| 8 import os | 8 import os |
| 9 import posixpath | 9 import posixpath |
| 10 import re | 10 import re |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 revision = revision.replace(self.remote + '/', 'refs/heads/') | 320 revision = revision.replace(self.remote + '/', 'refs/heads/') |
| 321 rev_type = "branch" | 321 rev_type = "branch" |
| 322 else: | 322 else: |
| 323 # hash is also a tag, only make a distinction at checkout | 323 # hash is also a tag, only make a distinction at checkout |
| 324 rev_type = "hash" | 324 rev_type = "hash" |
| 325 | 325 |
| 326 if (not os.path.exists(self.checkout_path) or | 326 if (not os.path.exists(self.checkout_path) or |
| 327 (os.path.isdir(self.checkout_path) and | 327 (os.path.isdir(self.checkout_path) and |
| 328 not os.path.exists(os.path.join(self.checkout_path, '.git')))): | 328 not os.path.exists(os.path.join(self.checkout_path, '.git')))): |
| 329 self._Clone(revision, url, options) | 329 self._Clone(revision, url, options) |
| 330 self._UpdateBranchHeads(options, fetch=True) |
| 330 self.UpdateSubmoduleConfig() | 331 self.UpdateSubmoduleConfig() |
| 331 if file_list is not None: | 332 if file_list is not None: |
| 332 files = self._Capture(['ls-files']).splitlines() | 333 files = self._Capture(['ls-files']).splitlines() |
| 333 file_list.extend([os.path.join(self.checkout_path, f) for f in files]) | 334 file_list.extend([os.path.join(self.checkout_path, f) for f in files]) |
| 334 if not verbose: | 335 if not verbose: |
| 335 # Make the output a little prettier. It's nice to have some whitespace | 336 # Make the output a little prettier. It's nice to have some whitespace |
| 336 # between projects when cloning. | 337 # between projects when cloning. |
| 337 print('') | 338 print('') |
| 338 return self._Capture(['rev-parse', '--verify', 'HEAD']) | 339 return self._Capture(['rev-parse', '--verify', 'HEAD']) |
| 339 | 340 |
| (...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1426 new_command.append('--force') | 1427 new_command.append('--force') |
| 1427 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1428 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
| 1428 new_command.extend(('--accept', 'theirs-conflict')) | 1429 new_command.extend(('--accept', 'theirs-conflict')) |
| 1429 elif options.manually_grab_svn_rev: | 1430 elif options.manually_grab_svn_rev: |
| 1430 new_command.append('--force') | 1431 new_command.append('--force') |
| 1431 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1432 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
| 1432 new_command.extend(('--accept', 'postpone')) | 1433 new_command.extend(('--accept', 'postpone')) |
| 1433 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1434 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
| 1434 new_command.extend(('--accept', 'postpone')) | 1435 new_command.extend(('--accept', 'postpone')) |
| 1435 return new_command | 1436 return new_command |
| OLD | NEW |