| 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 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 return base_url[:base_url.rfind('/')] + url | 725 return base_url[:base_url.rfind('/')] + url |
| 726 | 726 |
| 727 def _CreateOrUpdateCache(self, url, options): | 727 def _CreateOrUpdateCache(self, url, options): |
| 728 """Make a new git mirror or update existing mirror for |url|, and return the | 728 """Make a new git mirror or update existing mirror for |url|, and return the |
| 729 mirror URI to clone from. | 729 mirror URI to clone from. |
| 730 | 730 |
| 731 If no cache-dir is specified, just return |url| unchanged. | 731 If no cache-dir is specified, just return |url| unchanged. |
| 732 """ | 732 """ |
| 733 if not self.cache_dir: | 733 if not self.cache_dir: |
| 734 return url | 734 return url |
| 735 mirror_kwargs = { 'print_func': self.filter } | 735 mirror_kwargs = { |
| 736 'print_func': self.filter, |
| 737 'refs': [] |
| 738 } |
| 736 if url == CHROMIUM_SRC_URL or url + '.git' == CHROMIUM_SRC_URL: | 739 if url == CHROMIUM_SRC_URL or url + '.git' == CHROMIUM_SRC_URL: |
| 737 mirror_kwargs['refs'] = ['refs/tags/lkgr', 'refs/tags/lkcr'] | 740 mirror_kwargs['refs'].extend(['refs/tags/lkgr', 'refs/tags/lkcr']) |
| 741 if hasattr(options, 'with_branch_heads') and options.with_branch_heads: |
| 742 mirror_kwargs['refs'].append('refs/branch-heads/*') |
| 738 mirror = git_cache.Mirror(url, **mirror_kwargs) | 743 mirror = git_cache.Mirror(url, **mirror_kwargs) |
| 739 mirror.populate(verbose=options.verbose, bootstrap=True) | 744 mirror.populate(verbose=options.verbose, bootstrap=True) |
| 740 mirror.unlock() | 745 mirror.unlock() |
| 741 return mirror.mirror_path if mirror.exists() else None | 746 return mirror.mirror_path if mirror.exists() else None |
| 742 | 747 |
| 743 def _Clone(self, revision, url, options): | 748 def _Clone(self, revision, url, options): |
| 744 """Clone a git repository from the given URL. | 749 """Clone a git repository from the given URL. |
| 745 | 750 |
| 746 Once we've cloned the repo, we checkout a working branch if the specified | 751 Once we've cloned the repo, we checkout a working branch if the specified |
| 747 revision is a branch head. If it is a tag or a specific commit, then we | 752 revision is a branch head. If it is a tag or a specific commit, then we |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1456 new_command.append('--force') | 1461 new_command.append('--force') |
| 1457 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1462 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
| 1458 new_command.extend(('--accept', 'theirs-conflict')) | 1463 new_command.extend(('--accept', 'theirs-conflict')) |
| 1459 elif options.manually_grab_svn_rev: | 1464 elif options.manually_grab_svn_rev: |
| 1460 new_command.append('--force') | 1465 new_command.append('--force') |
| 1461 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1466 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
| 1462 new_command.extend(('--accept', 'postpone')) | 1467 new_command.extend(('--accept', 'postpone')) |
| 1463 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1468 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
| 1464 new_command.extend(('--accept', 'postpone')) | 1469 new_command.extend(('--accept', 'postpone')) |
| 1465 return new_command | 1470 return new_command |
| OLD | NEW |