| 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 collections | 7 import collections |
| 8 import logging | 8 import logging |
| 9 import os | 9 import os |
| 10 import posixpath | 10 import posixpath |
| (...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 789 os.path.exists(checkout_objects) and | 789 os.path.exists(checkout_objects) and |
| 790 not os.path.exists(checkout_altfile)) | 790 not os.path.exists(checkout_altfile)) |
| 791 | 791 |
| 792 v = ['-v'] if options.verbose else [] | 792 v = ['-v'] if options.verbose else [] |
| 793 filter_fn = lambda l: '[up to date]' not in l | 793 filter_fn = lambda l: '[up to date]' not in l |
| 794 with self.cache_locks[folder]: | 794 with self.cache_locks[folder]: |
| 795 gclient_utils.safe_makedirs(self.cache_dir) | 795 gclient_utils.safe_makedirs(self.cache_dir) |
| 796 if not os.path.exists(os.path.join(folder, 'config')): | 796 if not os.path.exists(os.path.join(folder, 'config')): |
| 797 gclient_utils.rmtree(folder) | 797 gclient_utils.rmtree(folder) |
| 798 cmd = ['clone'] + v + ['-c', 'core.deltaBaseCacheLimit=2g', | 798 cmd = ['clone'] + v + ['-c', 'core.deltaBaseCacheLimit=2g', |
| 799 '--progress', '--mirror'] | 799 '--progress', '--bare'] |
| 800 | 800 |
| 801 if use_reference: | 801 if use_reference: |
| 802 cmd += ['--reference', os.path.abspath(self.checkout_path)] | 802 cmd += ['--reference', os.path.abspath(self.checkout_path)] |
| 803 | 803 |
| 804 self._Run(cmd + [url, folder], | 804 self._Run(cmd + [url, folder], |
| 805 options, filter_fn=filter_fn, cwd=self.cache_dir, retry=True) | 805 options, filter_fn=filter_fn, cwd=self.cache_dir, retry=True) |
| 806 else: | 806 else: |
| 807 # For now, assert that host/path/to/repo.git is identical. We may want | 807 # For now, assert that host/path/to/repo.git is identical. We may want |
| 808 # to relax this restriction in the future to allow for smarter cache | 808 # to relax this restriction in the future to allow for smarter cache |
| 809 # repo update schemes (such as pulling the same repo, but from a | 809 # repo update schemes (such as pulling the same repo, but from a |
| (...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1539 new_command.append('--force') | 1539 new_command.append('--force') |
| 1540 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1540 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
| 1541 new_command.extend(('--accept', 'theirs-conflict')) | 1541 new_command.extend(('--accept', 'theirs-conflict')) |
| 1542 elif options.manually_grab_svn_rev: | 1542 elif options.manually_grab_svn_rev: |
| 1543 new_command.append('--force') | 1543 new_command.append('--force') |
| 1544 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1544 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
| 1545 new_command.extend(('--accept', 'postpone')) | 1545 new_command.extend(('--accept', 'postpone')) |
| 1546 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1546 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
| 1547 new_command.extend(('--accept', 'postpone')) | 1547 new_command.extend(('--accept', 'postpone')) |
| 1548 return new_command | 1548 return new_command |
| OLD | NEW |