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 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 | 649 |
650 Once we've cloned the repo, we checkout a working branch if the specified | 650 Once we've cloned the repo, we checkout a working branch if the specified |
651 revision is a branch head. If it is a tag or a specific commit, then we | 651 revision is a branch head. If it is a tag or a specific commit, then we |
652 leave HEAD detached as it makes future updates simpler -- in this case the | 652 leave HEAD detached as it makes future updates simpler -- in this case the |
653 user should first create a new branch or switch to an existing branch before | 653 user should first create a new branch or switch to an existing branch before |
654 making changes in the repo.""" | 654 making changes in the repo.""" |
655 if not options.verbose: | 655 if not options.verbose: |
656 # git clone doesn't seem to insert a newline properly before printing | 656 # git clone doesn't seem to insert a newline properly before printing |
657 # to stdout | 657 # to stdout |
658 print('') | 658 print('') |
659 template_path = os.path.join( | 659 clone_cmd = ['clone', '--progress'] |
660 os.path.dirname(THIS_FILE_PATH), 'git-templates') | |
661 clone_cmd = ['clone', '--progress', '--template=%s' % template_path] | |
662 if revision.startswith('refs/heads/'): | 660 if revision.startswith('refs/heads/'): |
663 clone_cmd.extend(['-b', revision.replace('refs/heads/', '')]) | 661 clone_cmd.extend(['-b', revision.replace('refs/heads/', '')]) |
664 detach_head = False | 662 detach_head = False |
665 else: | 663 else: |
666 detach_head = True | 664 detach_head = True |
667 if options.verbose: | 665 if options.verbose: |
668 clone_cmd.append('--verbose') | 666 clone_cmd.append('--verbose') |
669 clone_cmd.extend([url, self.checkout_path]) | 667 clone_cmd.extend([url, self.checkout_path]) |
670 | 668 |
671 # If the parent directory does not exist, Git clone on Windows will not | 669 # If the parent directory does not exist, Git clone on Windows will not |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1262 new_command.append('--force') | 1260 new_command.append('--force') |
1263 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1261 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1264 new_command.extend(('--accept', 'theirs-conflict')) | 1262 new_command.extend(('--accept', 'theirs-conflict')) |
1265 elif options.manually_grab_svn_rev: | 1263 elif options.manually_grab_svn_rev: |
1266 new_command.append('--force') | 1264 new_command.append('--force') |
1267 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1265 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1268 new_command.extend(('--accept', 'postpone')) | 1266 new_command.extend(('--accept', 'postpone')) |
1269 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1267 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1270 new_command.extend(('--accept', 'postpone')) | 1268 new_command.extend(('--accept', 'postpone')) |
1271 return new_command | 1269 return new_command |
OLD | NEW |