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 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 | 674 |
675 def _CreateOrUpdateCache(self, url, options): | 675 def _CreateOrUpdateCache(self, url, options): |
676 """Make a new git mirror or update existing mirror for |url|, and return the | 676 """Make a new git mirror or update existing mirror for |url|, and return the |
677 mirror URI to clone from. | 677 mirror URI to clone from. |
678 | 678 |
679 If no cache-dir is specified, just return |url| unchanged. | 679 If no cache-dir is specified, just return |url| unchanged. |
680 """ | 680 """ |
681 if not self.cache_dir: | 681 if not self.cache_dir: |
682 return url | 682 return url |
683 v = ['-v'] if options.verbose else [] | 683 v = ['-v'] if options.verbose else [] |
684 self._Run(['cache', 'populate'] + v + | 684 self._Run(['cache', 'populate'] + v + ['--cache-dir', self.cache_dir, url], |
685 ['--shallow', '--cache-dir', self.cache_dir, url], | |
686 options, cwd=self._root_dir, retry=True) | 685 options, cwd=self._root_dir, retry=True) |
687 return self._Run(['cache', 'exists', '--cache-dir', self.cache_dir, url], | 686 return self._Run(['cache', 'exists', '--cache-dir', self.cache_dir, url], |
688 options, cwd=self._root_dir, ).strip() | 687 options, cwd=self._root_dir, ).strip() |
689 | 688 |
690 def _Clone(self, revision, url, options): | 689 def _Clone(self, revision, url, options): |
691 """Clone a git repository from the given URL. | 690 """Clone a git repository from the given URL. |
692 | 691 |
693 Once we've cloned the repo, we checkout a working branch if the specified | 692 Once we've cloned the repo, we checkout a working branch if the specified |
694 revision is a branch head. If it is a tag or a specific commit, then we | 693 revision is a branch head. If it is a tag or a specific commit, then we |
695 leave HEAD detached as it makes future updates simpler -- in this case the | 694 leave HEAD detached as it makes future updates simpler -- in this case the |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1401 new_command.append('--force') | 1400 new_command.append('--force') |
1402 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1401 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1403 new_command.extend(('--accept', 'theirs-conflict')) | 1402 new_command.extend(('--accept', 'theirs-conflict')) |
1404 elif options.manually_grab_svn_rev: | 1403 elif options.manually_grab_svn_rev: |
1405 new_command.append('--force') | 1404 new_command.append('--force') |
1406 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1405 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1407 new_command.extend(('--accept', 'postpone')) | 1406 new_command.extend(('--accept', 'postpone')) |
1408 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1407 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1409 new_command.extend(('--accept', 'postpone')) | 1408 new_command.extend(('--accept', 'postpone')) |
1410 return new_command | 1409 return new_command |
OLD | NEW |