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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 mirror URI to clone from. | 731 mirror URI to clone from. |
732 | 732 |
733 If no cache-dir is specified, just return |url| unchanged. | 733 If no cache-dir is specified, just return |url| unchanged. |
734 """ | 734 """ |
735 if not self.cache_dir: | 735 if not self.cache_dir: |
736 return url | 736 return url |
737 mirror_kwargs = { | 737 mirror_kwargs = { |
738 'print_func': self.filter, | 738 'print_func': self.filter, |
739 'refs': [] | 739 'refs': [] |
740 } | 740 } |
741 if url == CHROMIUM_SRC_URL or url + '.git' == CHROMIUM_SRC_URL: | 741 # TODO(hinoka): This currently just fails because lkcr/lkgr are branches |
742 mirror_kwargs['refs'].extend(['refs/tags/lkgr', 'refs/tags/lkcr']) | 742 # not tags. This also adds 20 seconds to every bot_update |
| 743 # run, so I'm commenting this out until lkcr/lkgr become |
| 744 # tags. (2014/4/24) |
| 745 # if url == CHROMIUM_SRC_URL or url + '.git' == CHROMIUM_SRC_URL: |
| 746 # mirror_kwargs['refs'].extend(['refs/tags/lkgr', 'refs/tags/lkcr']) |
743 if hasattr(options, 'with_branch_heads') and options.with_branch_heads: | 747 if hasattr(options, 'with_branch_heads') and options.with_branch_heads: |
744 mirror_kwargs['refs'].append('refs/branch-heads/*') | 748 mirror_kwargs['refs'].append('refs/branch-heads/*') |
745 mirror = git_cache.Mirror(url, **mirror_kwargs) | 749 mirror = git_cache.Mirror(url, **mirror_kwargs) |
746 mirror.populate(verbose=options.verbose, bootstrap=True) | 750 mirror.populate(verbose=options.verbose, bootstrap=True) |
747 mirror.unlock() | 751 mirror.unlock() |
748 return mirror.mirror_path if mirror.exists() else None | 752 return mirror.mirror_path if mirror.exists() else None |
749 | 753 |
750 def _Clone(self, revision, url, options): | 754 def _Clone(self, revision, url, options): |
751 """Clone a git repository from the given URL. | 755 """Clone a git repository from the given URL. |
752 | 756 |
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1453 new_command.append('--force') | 1457 new_command.append('--force') |
1454 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1458 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1455 new_command.extend(('--accept', 'theirs-conflict')) | 1459 new_command.extend(('--accept', 'theirs-conflict')) |
1456 elif options.manually_grab_svn_rev: | 1460 elif options.manually_grab_svn_rev: |
1457 new_command.append('--force') | 1461 new_command.append('--force') |
1458 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1462 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1459 new_command.extend(('--accept', 'postpone')) | 1463 new_command.extend(('--accept', 'postpone')) |
1460 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1464 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1461 new_command.extend(('--accept', 'postpone')) | 1465 new_command.extend(('--accept', 'postpone')) |
1462 return new_command | 1466 return new_command |
OLD | NEW |