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 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 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 |
753 leave HEAD detached as it makes future updates simpler -- in this case the | 753 leave HEAD detached as it makes future updates simpler -- in this case the |
754 user should first create a new branch or switch to an existing branch before | 754 user should first create a new branch or switch to an existing branch before |
755 making changes in the repo.""" | 755 making changes in the repo.""" |
756 if not options.verbose: | 756 if not options.verbose: |
757 # git clone doesn't seem to insert a newline properly before printing | 757 # git clone doesn't seem to insert a newline properly before printing |
758 # to stdout | 758 # to stdout |
759 self.Print('') | 759 self.Print('') |
760 template_path = os.path.join( | 760 template_path = os.path.join( |
761 os.path.dirname(THIS_FILE_PATH), 'git-templates') | 761 os.path.dirname(THIS_FILE_PATH), 'git-templates') |
762 cfg = gclient_utils.DefaultIndexPackConfig(self.url) | 762 cfg = gclient_utils.DefaultIndexPackConfig(url) |
763 clone_cmd = cfg + [ | 763 clone_cmd = cfg + [ |
764 'clone', '--no-checkout', '--progress', '--template=%s' % template_path] | 764 'clone', '--no-checkout', '--progress', '--template=%s' % template_path] |
765 if self.cache_dir: | 765 if self.cache_dir: |
766 clone_cmd.append('--shared') | 766 clone_cmd.append('--shared') |
767 if options.verbose: | 767 if options.verbose: |
768 clone_cmd.append('--verbose') | 768 clone_cmd.append('--verbose') |
769 clone_cmd.append(url) | 769 clone_cmd.append(url) |
770 # If the parent directory does not exist, Git clone on Windows will not | 770 # If the parent directory does not exist, Git clone on Windows will not |
771 # create it, so we need to do it manually. | 771 # create it, so we need to do it manually. |
772 parent_dir = os.path.dirname(self.checkout_path) | 772 parent_dir = os.path.dirname(self.checkout_path) |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1458 new_command.append('--force') | 1458 new_command.append('--force') |
1459 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1459 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1460 new_command.extend(('--accept', 'theirs-conflict')) | 1460 new_command.extend(('--accept', 'theirs-conflict')) |
1461 elif options.manually_grab_svn_rev: | 1461 elif options.manually_grab_svn_rev: |
1462 new_command.append('--force') | 1462 new_command.append('--force') |
1463 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1463 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1464 new_command.extend(('--accept', 'postpone')) | 1464 new_command.extend(('--accept', 'postpone')) |
1465 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1465 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1466 new_command.extend(('--accept', 'postpone')) | 1466 new_command.extend(('--accept', 'postpone')) |
1467 return new_command | 1467 return new_command |
OLD | NEW |